From 8ea6e4bf5022f18ba0cd86a6320b52a76c6432a6 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 4 Nov 2024 16:04:28 +0530 Subject: [PATCH 01/24] feat: deployment files for the xvsvault treasury on arbitrum sepolia --- .../arbitrumsepolia/XVSVaultTreasury.json | 627 ++++++++++++++++ .../XVSVaultTreasury_Implementation.json | 672 ++++++++++++++++++ .../XVSVaultTreasury_Proxy.json | 281 ++++++++ .../176b6b19adc371c32ad674fe4863e12d.json | 238 +++++++ yarn.lock | 54 +- 5 files changed, 1836 insertions(+), 36 deletions(-) create mode 100644 deployments/arbitrumsepolia/XVSVaultTreasury.json create mode 100644 deployments/arbitrumsepolia/XVSVaultTreasury_Implementation.json create mode 100644 deployments/arbitrumsepolia/XVSVaultTreasury_Proxy.json create mode 100644 deployments/arbitrumsepolia/solcInputs/176b6b19adc371c32ad674fe4863e12d.json diff --git a/deployments/arbitrumsepolia/XVSVaultTreasury.json b/deployments/arbitrumsepolia/XVSVaultTreasury.json new file mode 100644 index 00000000..76475a65 --- /dev/null +++ b/deployments/arbitrumsepolia/XVSVaultTreasury.json @@ -0,0 +1,627 @@ +{ + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "FundsTransferredToXVSStore", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVault", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xvsVault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "transactionIndex": 1, + "gasUsed": "922193", + "logsBloom": "0x00000000000010000000000200000000400000000000000400804000000000040000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000002020001000000000000000000000000000000000000120000000000000000000800000000800000000000000000000000400000001000000000000000010040000000000000000080000000000000800000000400000000001000000000000400000040000000900000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000100000800000000000000000000000000", + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015", + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e0481f604d9b127f3bb93fa73cf3e48a9e47b82a" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 2, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": [ + "0x3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000407507dc2809d3aa31d54eca3bede5c5c4c8a17f" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a78a1df376c3ceebc5fab574fe6eddbbf76fd03e", + "logIndex": 5, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + } + ], + "blockNumber": 94289262, + "cumulativeGasUsed": "922193", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", + "0x485cc955000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f000000000000000000000000407507dc2809d3aa31d54eca3bede5c5c4c8a17f" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": ["0xa36AD96441cB931D8dFEAAaC97D3FaB4B39E590F", "0x407507DC2809D3aa31D54EcA3BEde5C5c4C8A17F"] + }, + "implementation": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/XVSVaultTreasury_Implementation.json b/deployments/arbitrumsepolia/XVSVaultTreasury_Implementation.json new file mode 100644 index 00000000..92aebca4 --- /dev/null +++ b/deployments/arbitrumsepolia/XVSVaultTreasury_Implementation.json @@ -0,0 +1,672 @@ +{ + "address": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "xvsAddress_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "FundsTransferredToXVSStore", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVault", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xvsVault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xd1d067edfcef4b3f0fbdc1857b27f5b1e6a8d70e2cc80bb9d1742ac00e612746", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "transactionIndex": 1, + "gasUsed": "1371509", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000024000000000000000000", + "blockHash": "0x8e4c37ea9a5304873da34e8ca227c63736beeb7e53cffc3aa123e1e5e2e71028", + "transactionHash": "0xd1d067edfcef4b3f0fbdc1857b27f5b1e6a8d70e2cc80bb9d1742ac00e612746", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94289250, + "transactionHash": "0xd1d067edfcef4b3f0fbdc1857b27f5b1e6a8d70e2cc80bb9d1742ac00e612746", + "address": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0x8e4c37ea9a5304873da34e8ca227c63736beeb7e53cffc3aa123e1e5e2e71028" + } + ], + "blockNumber": 94289250, + "cumulativeGasUsed": "1371509", + "status": 1, + "byzantium": true + }, + "args": ["0x877Dc896e7b13096D3827872e396927BbE704407"], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"xvsAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"xvsStore\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountMantissa\",\"type\":\"uint256\"}],\"name\":\"FundsTransferredToXVSStore\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldXVSVault\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newXVSVault\",\"type\":\"address\"}],\"name\":\"XVSVaultUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"XVS_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMantissa\",\"type\":\"uint256\"}],\"name\":\"fundXVSVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"xvsVault_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"xvsVault_\",\"type\":\"address\"}],\"name\":\"setXVSVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"xvsVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"xvsAddress_\":\"XVS token address\"}},\"fundXVSVault(uint256)\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"InsufficientBalance is thrown when amount entered is greater than balance\",\"custom:event\":\"FundsTransferredToXVSStore emits on success\",\"params\":{\"amountMantissa\":\"Amount to be sent to XVS vault\"}},\"initialize(address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when XVS vault address is zero\",\"custom:event\":\"XVSVaultUpdated emits on success\",\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"xvsVault_\":\"XVSVault address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setXVSVault(address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when XVS vault address is zero\",\"custom:event\":\"XVSVaultUpdated emits on success\",\"details\":\"XVS vault setter\",\"params\":{\"xvsVault_\":\"Address of the XVS vault\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zeroZeroValueNotAllowed is thrown when amount is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"Amount need to sweep from the contract\",\"to\":\"Address to which assets will be transferred\",\"tokenAddress\":\"Address of the asset(token)\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"stateVariables\":{\"XVS_ADDRESS\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"title\":\"XVSVaultTreasury\",\"version\":1},\"userdoc\":{\"errors\":{\"InsufficientBalance()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"FundsTransferredToXVSStore(address,uint256)\":{\"notice\":\"Emitted when funds transferred to XVSStore address\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"},\"XVSVaultUpdated(address,address)\":{\"notice\":\"Emitted when XVS vault address is updated\"}},\"kind\":\"user\",\"methods\":{\"XVS_ADDRESS()\":{\"notice\":\"The xvs token address\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"fundXVSVault(uint256)\":{\"notice\":\"This function transfers funds to the XVS vault\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"Function to sweep tokens from the contract\"},\"xvsVault()\":{\"notice\":\"The xvsvault address\"}},\"notice\":\"XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProtocolReserve/XVSVaultTreasury.sol\":\"XVSVaultTreasury\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\\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\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\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 cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IXVSVault.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\n/// @title IXVSVaultProxy\\n/// @author Venus\\n/// @notice Interface implemented by `XVSVault`.\\ninterface IXVSVault {\\n function xvsStore() external view returns (address);\\n}\\n\",\"keccak256\":\"0x1d43ccb525a08929eccdd6e3f256ca38b1f8a4bcba290661c72f4e564fd0f1db\",\"license\":\"BSD-3-Clause\"},\"contracts/ProtocolReserve/XVSVaultTreasury.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { IXVSVault } from \\\"../Interfaces/IXVSVault.sol\\\";\\n\\n/// @title XVSVaultTreasury\\n/// @author Venus\\n/// @notice XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract XVSVaultTreasury is AccessControlledV8, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice The xvs token address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable XVS_ADDRESS;\\n\\n /// @notice The xvsvault address\\n address public xvsVault;\\n\\n /// @notice Emitted when XVS vault address is updated\\n event XVSVaultUpdated(address indexed oldXVSVault, address indexed newXVSVault);\\n\\n /// @notice Emitted when funds transferred to XVSStore address\\n event FundsTransferredToXVSStore(address indexed xvsStore, uint256 amountMantissa);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientBalance();\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n /// @param xvsAddress_ XVS token address\\n constructor(address xvsAddress_) {\\n ensureNonzeroAddress(xvsAddress_);\\n XVS_ADDRESS = xvsAddress_;\\n\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param xvsVault_ XVSVault address\\n /// @custom:event XVSVaultUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\\n function initialize(address accessControlManager_, address xvsVault_) public initializer {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n _setXVSVault(xvsVault_);\\n }\\n\\n /// @dev XVS vault setter\\n /// @param xvsVault_ Address of the XVS vault\\n /// @custom:event XVSVaultUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\\n function setXVSVault(address xvsVault_) external onlyOwner {\\n _setXVSVault(xvsVault_);\\n }\\n\\n /// @notice This function transfers funds to the XVS vault\\n /// @param amountMantissa Amount to be sent to XVS vault\\n /// @custom:event FundsTransferredToXVSStore emits on success\\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\\n /// @custom:access Restricted by ACM\\n function fundXVSVault(uint256 amountMantissa) external nonReentrant {\\n _checkAccessAllowed(\\\"fundXVSVault(uint256)\\\");\\n ensureNonzeroValue(amountMantissa);\\n\\n uint256 balance = IERC20Upgradeable(XVS_ADDRESS).balanceOf(address(this));\\n\\n if (balance < amountMantissa) {\\n revert InsufficientBalance();\\n }\\n\\n address xvsStore = IXVSVault(xvsVault).xvsStore();\\n ensureNonzeroAddress(xvsStore);\\n IERC20Upgradeable(XVS_ADDRESS).safeTransfer(xvsStore, amountMantissa);\\n\\n emit FundsTransferredToXVSStore(xvsStore, amountMantissa);\\n }\\n\\n /// @notice Function to sweep tokens from the contract\\n /// @param tokenAddress Address of the asset(token)\\n /// @param to Address to which assets will be transferred\\n /// @param amount Amount need to sweep from the contract\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @dev XVS vault setter\\n /// @param xvsVault_ Address of the XVS vault\\n /// @custom:event XVSVaultUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\\n function _setXVSVault(address xvsVault_) internal {\\n ensureNonzeroAddress(xvsVault_);\\n emit XVSVaultUpdated(xvsVault, xvsVault_);\\n xvsVault = xvsVault_;\\n }\\n}\\n\",\"keccak256\":\"0x9f2e4ebeb5ece0031ac34bceac4386dbab16cac5f93faf211985d0efaa7811ab\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b5060405161175938038061175983398101604081905261002f9161013c565b61003881610053565b6001600160a01b03811660805261004d61007d565b5061016c565b6001600160a01b03811661007a576040516342bcdf7f60e11b815260040160405180910390fd5b50565b600054610100900460ff16156100e95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161461013a576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60006020828403121561014e57600080fd5b81516001600160a01b038116811461016557600080fd5b9392505050565b6080516115c46101956000396000818161016d015281816105d3015261074801526115c46000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c8063715018a61161008c5780639a02c39a116100665780639a02c39a146101d0578063b4a0bdf3146101e3578063e30c397814610201578063f2fde38b1461021f57600080fd5b8063715018a6146101a257806379ba5097146101aa5780638da5cb5b146101b257600080fd5b8063485cc955116100bd578063485cc9551461015557806354a617ed1461016857806364aff9ec1461018f57600080fd5b80630e32cb86146100e457806314d35a63146100f95780631b9ce5751461010c575b600080fd5b6100f76100f2366004611371565b610232565b005b6100f7610107366004611371565b610246565b60fb5461012c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100f7610163366004611395565b610257565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6100f761019d3660046113ce565b6103e8565b6100f76104a7565b6100f76104bb565b60335473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f76101de36600461140f565b610553565b60975473ffffffffffffffffffffffffffffffffffffffff1661012c565b60655473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f761022d366004611371565b6107cb565b61023a61087b565b610243816108e2565b50565b61024e61087b565b610243816109f1565b600054610100900460ff16158080156102775750600054600160ff909116105b806102915750303b158015610291575060005460ff166001145b6103085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61036f83610a88565b610377610b16565b610380826109f1565b80156103e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6103f061087b565b6103f8610b9b565b61040183610bf4565b61040a82610bf4565b61041381610c41565b8261043573ffffffffffffffffffffffffffffffffffffffff82168484610c7b565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d58460405161049491815260200190565b60405180910390a3506103e3600160c955565b6104af61087b565b6104b96000610d0f565b565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461054a5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016102ff565b61024381610d0f565b61055b610b9b565b6105996040518060400160405280601581526020017f66756e645856535661756c742875696e74323536290000000000000000000000815250610d40565b6105a281610c41565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561062f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106539190611428565b90508181101561068f576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb54604080517f24f52bbf000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916324f52bbf9160048083019260209291908290030181865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107239190611441565b905061072e81610bf4565b61076f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168285610c7b565b8073ffffffffffffffffffffffffffffffffffffffff167f15daab32014613a1f6e3f4500519c6ae9f7b172530faeac09157815d4f395381846040516107b791815260200190565b60405180910390a25050610243600160c955565b6107d361087b565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561083660335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60335473ffffffffffffffffffffffffffffffffffffffff1633146104b95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ff565b73ffffffffffffffffffffffffffffffffffffffff811661096b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016102ff565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b6109fa81610bf4565b60fb5460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a90600090a360fb80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16610b055760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b610b0d610e1d565b61024381610ea2565b600054610100900460ff16610b935760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9610f1f565b600260c95403610bed5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ff565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610243576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003610243576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526103e3908490610f9c565b600160c955565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561024381611091565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab90610d9990339086906004016114cc565b602060405180830381865afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906114fb565b905080610e19573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016102ff9392919061151d565b5050565b600054610100900460ff16610e9a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9611108565b600054610100900460ff1661023a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b600054610100900460ff16610d085760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6000610ffe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661118e9092919063ffffffff16565b905080516000148061101f57508080602001905181019061101f91906114fb565b6103e35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102ff565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166111855760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b933610d0f565b606061119d84846000856111a5565b949350505050565b60608247101561121d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102ff565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611246919061155f565b60006040518083038185875af1925050503d8060008114611283576040519150601f19603f3d011682016040523d82523d6000602084013e611288565b606091505b5091509150611299878383876112a4565b979650505050505050565b606083156113205782516000036113195773ffffffffffffffffffffffffffffffffffffffff85163b6113195760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102ff565b508161119d565b61119d83838151156113355781518083602001fd5b8060405162461bcd60e51b81526004016102ff919061157b565b73ffffffffffffffffffffffffffffffffffffffff8116811461024357600080fd5b60006020828403121561138357600080fd5b813561138e8161134f565b9392505050565b600080604083850312156113a857600080fd5b82356113b38161134f565b915060208301356113c38161134f565b809150509250929050565b6000806000606084860312156113e357600080fd5b83356113ee8161134f565b925060208401356113fe8161134f565b929592945050506040919091013590565b60006020828403121561142157600080fd5b5035919050565b60006020828403121561143a57600080fd5b5051919050565b60006020828403121561145357600080fd5b815161138e8161134f565b60005b83811015611479578181015183820152602001611461565b50506000910152565b6000815180845261149a81602086016020860161145e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061119d6040830184611482565b60006020828403121561150d57600080fd5b8151801515811461138e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526115566060830184611482565b95945050505050565b6000825161157181846020870161145e565b9190910192915050565b60208152600061138e602083018461148256fea26469706673582212203c97736c79eecd2598b8f7c00cad09d14a710f0a7649e22c0559ee40d7a25f1264736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c8063715018a61161008c5780639a02c39a116100665780639a02c39a146101d0578063b4a0bdf3146101e3578063e30c397814610201578063f2fde38b1461021f57600080fd5b8063715018a6146101a257806379ba5097146101aa5780638da5cb5b146101b257600080fd5b8063485cc955116100bd578063485cc9551461015557806354a617ed1461016857806364aff9ec1461018f57600080fd5b80630e32cb86146100e457806314d35a63146100f95780631b9ce5751461010c575b600080fd5b6100f76100f2366004611371565b610232565b005b6100f7610107366004611371565b610246565b60fb5461012c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100f7610163366004611395565b610257565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6100f761019d3660046113ce565b6103e8565b6100f76104a7565b6100f76104bb565b60335473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f76101de36600461140f565b610553565b60975473ffffffffffffffffffffffffffffffffffffffff1661012c565b60655473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f761022d366004611371565b6107cb565b61023a61087b565b610243816108e2565b50565b61024e61087b565b610243816109f1565b600054610100900460ff16158080156102775750600054600160ff909116105b806102915750303b158015610291575060005460ff166001145b6103085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61036f83610a88565b610377610b16565b610380826109f1565b80156103e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6103f061087b565b6103f8610b9b565b61040183610bf4565b61040a82610bf4565b61041381610c41565b8261043573ffffffffffffffffffffffffffffffffffffffff82168484610c7b565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d58460405161049491815260200190565b60405180910390a3506103e3600160c955565b6104af61087b565b6104b96000610d0f565b565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461054a5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016102ff565b61024381610d0f565b61055b610b9b565b6105996040518060400160405280601581526020017f66756e645856535661756c742875696e74323536290000000000000000000000815250610d40565b6105a281610c41565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561062f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106539190611428565b90508181101561068f576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb54604080517f24f52bbf000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916324f52bbf9160048083019260209291908290030181865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107239190611441565b905061072e81610bf4565b61076f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168285610c7b565b8073ffffffffffffffffffffffffffffffffffffffff167f15daab32014613a1f6e3f4500519c6ae9f7b172530faeac09157815d4f395381846040516107b791815260200190565b60405180910390a25050610243600160c955565b6107d361087b565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561083660335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60335473ffffffffffffffffffffffffffffffffffffffff1633146104b95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ff565b73ffffffffffffffffffffffffffffffffffffffff811661096b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016102ff565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b6109fa81610bf4565b60fb5460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a90600090a360fb80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16610b055760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b610b0d610e1d565b61024381610ea2565b600054610100900460ff16610b935760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9610f1f565b600260c95403610bed5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ff565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610243576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003610243576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526103e3908490610f9c565b600160c955565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561024381611091565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab90610d9990339086906004016114cc565b602060405180830381865afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906114fb565b905080610e19573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016102ff9392919061151d565b5050565b600054610100900460ff16610e9a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9611108565b600054610100900460ff1661023a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b600054610100900460ff16610d085760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6000610ffe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661118e9092919063ffffffff16565b905080516000148061101f57508080602001905181019061101f91906114fb565b6103e35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102ff565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166111855760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b933610d0f565b606061119d84846000856111a5565b949350505050565b60608247101561121d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102ff565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611246919061155f565b60006040518083038185875af1925050503d8060008114611283576040519150601f19603f3d011682016040523d82523d6000602084013e611288565b606091505b5091509150611299878383876112a4565b979650505050505050565b606083156113205782516000036113195773ffffffffffffffffffffffffffffffffffffffff85163b6113195760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102ff565b508161119d565b61119d83838151156113355781518083602001fd5b8060405162461bcd60e51b81526004016102ff919061157b565b73ffffffffffffffffffffffffffffffffffffffff8116811461024357600080fd5b60006020828403121561138357600080fd5b813561138e8161134f565b9392505050565b600080604083850312156113a857600080fd5b82356113b38161134f565b915060208301356113c38161134f565b809150509250929050565b6000806000606084860312156113e357600080fd5b83356113ee8161134f565b925060208401356113fe8161134f565b929592945050506040919091013590565b60006020828403121561142157600080fd5b5035919050565b60006020828403121561143a57600080fd5b5051919050565b60006020828403121561145357600080fd5b815161138e8161134f565b60005b83811015611479578181015183820152602001611461565b50506000910152565b6000815180845261149a81602086016020860161145e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061119d6040830184611482565b60006020828403121561150d57600080fd5b8151801515811461138e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526115566060830184611482565b95945050505050565b6000825161157181846020870161145e565b9190910192915050565b60208152600061138e602083018461148256fea26469706673582212203c97736c79eecd2598b8f7c00cad09d14a710f0a7649e22c0559ee40d7a25f1264736f6c63430008190033", + "devdoc": { + "author": "Venus", + "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor", + "params": { + "xvsAddress_": "XVS token address" + } + }, + "fundXVSVault(uint256)": { + "custom:access": "Restricted by ACM", + "custom:error": "InsufficientBalance is thrown when amount entered is greater than balance", + "custom:event": "FundsTransferredToXVSStore emits on success", + "params": { + "amountMantissa": "Amount to be sent to XVS vault" + } + }, + "initialize(address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when XVS vault address is zero", + "custom:event": "XVSVaultUpdated emits on success", + "params": { + "accessControlManager_": "Access control manager contract address", + "xvsVault_": "XVSVault address" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setXVSVault(address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when XVS vault address is zero", + "custom:event": "XVSVaultUpdated emits on success", + "details": "XVS vault setter", + "params": { + "xvsVault_": "Address of the XVS vault" + } + }, + "sweepToken(address,address,uint256)": { + "custom:access": "Only Governance", + "custom:error": "ZeroAddressNotAllowed is thrown when tokenAddress/to address is zeroZeroValueNotAllowed is thrown when amount is zero", + "custom:event": "Emits SweepToken event on success", + "params": { + "amount": "Amount need to sweep from the contract", + "to": "Address to which assets will be transferred", + "tokenAddress": "Address of the asset(token)" + } + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + } + }, + "stateVariables": { + "XVS_ADDRESS": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + } + }, + "title": "XVSVaultTreasury", + "version": 1 + }, + "userdoc": { + "errors": { + "InsufficientBalance()": [ + { + "notice": "Thrown when given input amount is zero" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ], + "ZeroValueNotAllowed()": [ + { + "notice": "Thrown if the supplied value is 0 where it is not allowed" + } + ] + }, + "events": { + "FundsTransferredToXVSStore(address,uint256)": { + "notice": "Emitted when funds transferred to XVSStore address" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + }, + "SweepToken(address,address,uint256)": { + "notice": "Event emitted when tokens are swept" + }, + "XVSVaultUpdated(address,address)": { + "notice": "Emitted when XVS vault address is updated" + } + }, + "kind": "user", + "methods": { + "XVS_ADDRESS()": { + "notice": "The xvs token address" + }, + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "fundXVSVault(uint256)": { + "notice": "This function transfers funds to the XVS vault" + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "sweepToken(address,address,uint256)": { + "notice": "Function to sweep tokens from the contract" + }, + "xvsVault()": { + "notice": "The xvsvault address" + } + }, + "notice": "XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 547, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_status", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 616, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 8737, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "xvsVault", + "offset": 0, + "slot": "251", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/arbitrumsepolia/XVSVaultTreasury_Proxy.json b/deployments/arbitrumsepolia/XVSVaultTreasury_Proxy.json new file mode 100644 index 00000000..446c2d3c --- /dev/null +++ b/deployments/arbitrumsepolia/XVSVaultTreasury_Proxy.json @@ -0,0 +1,281 @@ +{ + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "transactionIndex": 1, + "gasUsed": "922193", + "logsBloom": "0x00000000000010000000000200000000400000000000000400804000000000040000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000002020001000000000000000000000000000000000000120000000000000000000800000000800000000000000000000000400000001000000000000000010040000000000000000080000000000000800000000400000000001000000000000400000040000000900000000000000000000000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000100000800000000000000000000000000", + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015", + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e0481f604d9b127f3bb93fa73cf3e48a9e47b82a" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 2, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": [ + "0x3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000407507dc2809d3aa31d54eca3bede5c5c4c8a17f" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + }, + { + "transactionIndex": 1, + "blockNumber": 94289262, + "transactionHash": "0x17a6396ca6f53488938e74d67563a3aed4b2a43e54354904af8a683e1719695b", + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a78a1df376c3ceebc5fab574fe6eddbbf76fd03e", + "logIndex": 5, + "blockHash": "0x817ca0a9716357775b94630da10a377a1fc0ecb3d2262a78b439071c1a7ba015" + } + ], + "blockNumber": 94289262, + "cumulativeGasUsed": "922193", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", + "0x485cc955000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f000000000000000000000000407507dc2809d3aa31d54eca3bede5c5c4c8a17f" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/solcInputs/176b6b19adc371c32ad674fe4863e12d.json b/deployments/arbitrumsepolia/solcInputs/176b6b19adc371c32ad674fe4863e12d.json new file mode 100644 index 00000000..a413dede --- /dev/null +++ b/deployments/arbitrumsepolia/solcInputs/176b6b19adc371c32ad674fe4863e12d.json @@ -0,0 +1,238 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\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" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\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 cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1967.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/IERC1967.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(ITransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(ITransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n ITransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(address) external;\n\n function upgradeTo(address) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) {\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n revert(\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return \"\";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() private {\n require(msg.value == 0);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@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" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^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 // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\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(uint256 x, uint256 y, uint256 denominator, Rounding rounding) 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 // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `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 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.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 `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n 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 /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface VBep20Interface is IERC20Metadata {\n /**\n * @notice Underlying asset for this VToken\n */\n function underlying() external view returns (address);\n}\n" + }, + "@venusprotocol/oracle/contracts/ResilientOracle.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\n// SPDX-FileCopyrightText: 2022 Venus\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"./interfaces/VBep20Interface.sol\";\nimport \"./interfaces/OracleInterface.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\n\n/**\n * @title ResilientOracle\n * @author Venus\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\n * \n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\n * for attacking the protocol.\n * \n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\n * \n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \n * \n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\n * market. The upper bound ratio represents the deviation between reported price (the price that’s being\n * validated) and the anchor price (the price we are validating against) above which the reported price will\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\n * should be true:\n\n```\nanchorRatio = anchorPrice/reporterPrice\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\n```\n\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \n * \n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\n * oracle to be stagnant and treat it like it's disabled.\n */\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\n /**\n * @dev Oracle roles:\n * **main**: The most trustworthy price source\n * **pivot**: Price oracle used as a loose sanity checker\n * **fallback**: The backup source when main oracle price is invalidated\n */\n enum OracleRole {\n MAIN,\n PIVOT,\n FALLBACK\n }\n\n struct TokenConfig {\n /// @notice asset address\n address asset;\n /// @notice `oracles` stores the oracles based on their role in the following order:\n /// [main, pivot, fallback],\n /// It can be indexed with the corresponding enum OracleRole value\n address[3] oracles;\n /// @notice `enableFlagsForOracles` stores the enabled state\n /// for each oracle in the same order as `oracles`\n bool[3] enableFlagsForOracles;\n }\n\n uint256 public constant INVALID_PRICE = 0;\n\n /// @notice Native market address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable nativeMarket;\n\n /// @notice VAI address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vai;\n\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\n /// and can serve as any underlying asset of a market that supports native tokens\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\n\n /// @notice Bound validator contract address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n BoundValidatorInterface public immutable boundValidator;\n\n mapping(address => TokenConfig) private tokenConfigs;\n\n event TokenConfigAdded(\n address indexed asset,\n address indexed mainOracle,\n address indexed pivotOracle,\n address fallbackOracle\n );\n\n /// Event emitted when an oracle is set\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\n\n /// Event emitted when an oracle is enabled or disabled\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\n\n /**\n * @notice Checks whether an address is null or not\n */\n modifier notNullAddress(address someone) {\n if (someone == address(0)) revert(\"can't be zero address\");\n _;\n }\n\n /**\n * @notice Checks whether token config exists by checking whether asset is null address\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\n * @param asset asset address\n */\n modifier checkTokenConfigExistence(address asset) {\n if (tokenConfigs[asset].asset == address(0)) revert(\"token config must exist\");\n _;\n }\n\n /// @notice Constructor for the implementation contract. Sets immutable variables.\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\n /// (e.g vETH on ethereum would not be supported, only vWETH)\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\n /// Set to address(0) of VAI is not existent.\n /// @param _boundValidator Address of the bound validator contract\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address nativeMarketAddress,\n address vaiAddress,\n BoundValidatorInterface _boundValidator\n ) notNullAddress(address(_boundValidator)) {\n nativeMarket = nativeMarketAddress;\n vai = vaiAddress;\n boundValidator = _boundValidator;\n\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract admin and sets the BoundValidator contract address\n * @param accessControlManager_ Address of the access control manager contract\n */\n function initialize(address accessControlManager_) external initializer {\n __AccessControlled_init(accessControlManager_);\n __Pausable_init();\n }\n\n /**\n * @notice Pauses oracle\n * @custom:access Only Governance\n */\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n _pause();\n }\n\n /**\n * @notice Unpauses oracle\n * @custom:access Only Governance\n */\n function unpause() external {\n _checkAccessAllowed(\"unpause()\");\n _unpause();\n }\n\n /**\n * @notice Batch sets token configs\n * @param tokenConfigs_ Token config array\n * @custom:access Only Governance\n * @custom:error Throws a length error if the length of the token configs array is 0\n */\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\n if (tokenConfigs_.length == 0) revert(\"length can't be 0\");\n uint256 numTokenConfigs = tokenConfigs_.length;\n for (uint256 i; i < numTokenConfigs; ) {\n setTokenConfig(tokenConfigs_[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @notice Sets oracle for a given asset and role.\n * @dev Supplied asset **must** exist and main oracle may not be null\n * @param asset Asset address\n * @param oracle Oracle address\n * @param role Oracle role\n * @custom:access Only Governance\n * @custom:error Null address error if main-role oracle address is null\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\n */\n function setOracle(\n address asset,\n address oracle,\n OracleRole role\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"setOracle(address,address,uint8)\");\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\"can't set zero address to main oracle\");\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\n emit OracleSet(asset, oracle, uint256(role));\n }\n\n /**\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\n * @param asset Asset address\n * @param role Oracle role\n * @param enable Enabled boolean of the oracle\n * @custom:access Only Governance\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n */\n function enableOracle(\n address asset,\n OracleRole role,\n bool enable\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"enableOracle(address,uint8,bool)\");\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\n emit OracleEnabled(asset, uint256(role), enable);\n }\n\n /**\n * @notice Updates the TWAP pivot oracle price.\n * @dev This function should always be called before calling getUnderlyingPrice\n * @param vToken vToken address\n */\n function updatePrice(address vToken) external override {\n address asset = _getUnderlyingAsset(vToken);\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @notice Updates the pivot oracle price. Currently using TWAP\n * @dev This function should always be called before calling getPrice\n * @param asset asset address\n */\n function updateAssetPrice(address asset) external {\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @dev Gets token config by asset address\n * @param asset asset address\n * @return tokenConfig Config for the asset\n */\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\n return tokenConfigs[asset];\n }\n\n /**\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\n * - Check if the oracle is paused globally\n * - Validate price from main oracle against pivot oracle\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\n * - Validate price from main oracle against fallback oracle if the second validation failed\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\n * main oracle price is returned.\n * @param vToken vToken address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n\n address asset = _getUnderlyingAsset(vToken);\n return _getPrice(asset);\n }\n\n /**\n * @notice Gets price of the asset\n * @param asset asset address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getPrice(address asset) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n return _getPrice(asset);\n }\n\n /**\n * @notice Sets/resets single token configs.\n * @dev main oracle **must not** be a null address\n * @param tokenConfig Token config struct\n * @custom:access Only Governance\n * @custom:error NotNullAddress is thrown if asset address is null\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\n */\n function setTokenConfig(\n TokenConfig memory tokenConfig\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\n _checkAccessAllowed(\"setTokenConfig(TokenConfig)\");\n\n tokenConfigs[tokenConfig.asset] = tokenConfig;\n emit TokenConfigAdded(\n tokenConfig.asset,\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\n );\n }\n\n /**\n * @notice Gets oracle and enabled status by asset address\n * @param asset asset address\n * @param role Oracle role\n * @return oracle Oracle address based on role\n * @return enabled Enabled flag of the oracle based on token config\n */\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\n oracle = tokenConfigs[asset].oracles[uint256(role)];\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\n }\n\n function _getPrice(address asset) internal view returns (uint256) {\n uint256 pivotPrice = INVALID_PRICE;\n\n // Get pivot oracle price, Invalid price if not available or error\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracleEnabled && pivotOracle != address(0)) {\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\n pivotPrice = pricePivot;\n } catch {}\n }\n\n // Compare main price and pivot price, return main price and if validation was successful\n // note: In case pivot oracle is not available but main price is available and\n // validation is successful, the main oracle price is returned.\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\n asset,\n pivotPrice,\n pivotOracleEnabled && pivotOracle != address(0)\n );\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\n\n // Compare fallback and pivot if main oracle comparision fails with pivot\n // Return fallback price when fallback price is validated successfully with pivot oracle\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\n\n // Lastly compare main price and fallback price\n if (\n mainPrice != INVALID_PRICE &&\n fallbackPrice != INVALID_PRICE &&\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\n ) {\n return mainPrice;\n }\n\n revert(\"invalid resilient oracle price\");\n }\n\n /**\n * @notice Gets a price for the provided asset\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\n * able to fetch a correct price\n * @param asset asset address\n * @param pivotPrice Pivot oracle price\n * @param pivotEnabled If pivot oracle is not empty and enabled\n * @return price USD price in scaled decimals\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\n * @return pivotValidated Boolean representing if the validation of main oracle price\n * and pivot oracle price were successful\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\n * address is null\n */\n function _getMainOraclePrice(\n address asset,\n uint256 pivotPrice,\n bool pivotEnabled\n ) internal view returns (uint256, bool) {\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\n if (mainOracleEnabled && mainOracle != address(0)) {\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\n if (!pivotEnabled) {\n return (mainOraclePrice, true);\n }\n if (pivotPrice == INVALID_PRICE) {\n return (mainOraclePrice, false);\n }\n return (\n mainOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\n * @param asset asset address\n * @return price USD price in 18 decimals\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\n * and pivot oracle price were successfull\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\n * address is null\n */\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\n if (fallbackEnabled && fallbackOracle != address(0)) {\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\n if (pivotPrice == INVALID_PRICE) {\n return (fallbackOraclePrice, false);\n }\n return (\n fallbackOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function returns the underlying asset of a vToken\n * @param vToken vToken address\n * @return asset underlying asset address\n */\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\n if (vToken == nativeMarket) {\n asset = NATIVE_TOKEN_ADDR;\n } else if (vToken == vai) {\n asset = vai;\n } else {\n asset = VBep20Interface(vToken).underlying();\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/constants.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\nuint256 constant EXP_SCALE = 1e18;\n\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\nuint256 constant MANTISSA_ONE = EXP_SCALE;\n\n/// @dev The approximate number of seconds per year\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\n" + }, + "@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/**\n * @title MaxLoopsLimitHelper\n * @author Venus\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\n */\nabstract contract MaxLoopsLimitHelper {\n // Limit for the loops to avoid the DOS\n uint256 public maxLoopsLimit;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when max loops limit is set\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\n\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n */\n function _setMaxLoopsLimit(uint256 limit) internal {\n require(limit > maxLoopsLimit, \"Comptroller: Invalid maxLoopsLimit\");\n\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\n maxLoopsLimit = limit;\n\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\n }\n\n /**\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\n * @param len Length of the loops iterate\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\n */\n function _ensureMaxLoops(uint256 len) internal view {\n if (len > maxLoopsLimit) {\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/validators.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\nerror ZeroAddressNotAllowed();\n\n/// @notice Thrown if the supplied value is 0 where it is not allowed\nerror ZeroValueNotAllowed();\n\n/// @notice Checks if the provided address is nonzero, reverts otherwise\n/// @param address_ Address to check\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\nfunction ensureNonzeroAddress(address address_) pure {\n if (address_ == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n}\n\n/// @notice Checks if the provided value is nonzero, reverts otherwise\n/// @param value_ Value to check\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\nfunction ensureNonzeroValue(uint256 value_) pure {\n if (value_ == 0) {\n revert ZeroValueNotAllowed();\n }\n}\n" + }, + "contracts/Interfaces/IComptroller.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IComptroller {\n function isComptroller() external view returns (bool);\n\n function markets(address) external view returns (bool);\n\n function getAllMarkets() external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { IAbstractTokenConverter } from \"../TokenConverter/IAbstractTokenConverter.sol\";\n\n/**\n * @title IConverterNetwork\n * @author Venus\n * @notice Interface implemented by `ConverterNetwork`.\n */\ninterface IConverterNetwork {\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\n\n /// @notice This function checks for given address is converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return boolean true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool);\n}\n" + }, + "contracts/Interfaces/IIncomeDestination.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IIncomeDestination {\n function updateAssetsState(address comptroller, address asset) external;\n}\n" + }, + "contracts/Interfaces/IPoolRegistry.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IPoolRegistry {\n /// @notice Get VToken in the Pool for an Asset\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\n\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IProtocolShareReserve {\n /// @notice it represents the type of vToken income\n enum IncomeType {\n SPREAD,\n LIQUIDATION\n }\n\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) external;\n}\n" + }, + "contracts/Interfaces/IRiskFund.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IRiskFund\n * @author Venus\n * @notice Interface implemented by `RiskFund`.\n */\ninterface IRiskFund {\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\n\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) external;\n\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\n}\n\n/**\n * @title IRiskFundGetters\n * @author Venus\n * @notice Interface implemented by `RiskFund` for getter methods.\n */\ninterface IRiskFundGetters {\n function convertibleBaseAsset() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IRiskFundConverter {\n function updateAssetsState(address comptroller, address asset) external;\n\n function getPools(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IShortfall.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IShortfall\n * @author Venus\n * @notice Interface implemented by `Shortfall`.\n */\ninterface IShortfall {\n function convertibleBaseAsset() external returns (address);\n}\n" + }, + "contracts/Interfaces/IVToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IVToken {\n function underlying() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IXVSVault.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @title IXVSVaultProxy\n/// @author Venus\n/// @notice Interface implemented by `XVSVault`.\ninterface IXVSVault {\n function xvsStore() external view returns (address);\n}\n" + }, + "contracts/ProtocolReserve/ProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable, IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IProtocolShareReserve } from \"../Interfaces/IProtocolShareReserve.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\nimport { IIncomeDestination } from \"../Interfaces/IIncomeDestination.sol\";\n\nerror InvalidAddress();\nerror UnsupportedAsset();\nerror InvalidTotalPercentage();\nerror InvalidMaxLoopsLimit();\n\ncontract ProtocolShareReserve is\n AccessControlledV8,\n ReentrancyGuardUpgradeable,\n MaxLoopsLimitHelper,\n IProtocolShareReserve\n{\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice protocol income is categorized into two schemas.\n /// The first schema is for spread income\n /// The second schema is for liquidation income\n enum Schema {\n PROTOCOL_RESERVES,\n ADDITIONAL_REVENUE\n }\n\n struct DistributionConfig {\n Schema schema;\n /// @dev percenatge is represented without any scale\n uint16 percentage;\n address destination;\n }\n\n /// @notice address of core pool comptroller contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n /// @notice address of WBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable WBNB;\n\n /// @notice address of vBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vBNB;\n\n /// @notice address of pool registry contract\n address public poolRegistry;\n\n uint16 public constant MAX_PERCENT = 1e4;\n\n /// @notice comptroller => asset => schema => balance\n mapping(address => mapping(address => mapping(Schema => uint256))) public assetsReserves;\n\n /// @notice asset => balance\n mapping(address => uint256) public totalAssetReserve;\n\n /// @notice configuration for different income distribution targets\n DistributionConfig[] public distributionTargets;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Event emitted after updating of the assets reserves.\n event AssetsReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n uint256 amount,\n IncomeType incomeType,\n Schema schema\n );\n\n /// @notice Event emitted when an asset is released to a target\n event AssetReleased(\n address indexed destination,\n address indexed asset,\n Schema schema,\n uint256 percent,\n uint256 amount\n );\n\n /// @notice Event emitted when asset reserves state is updated\n event ReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n Schema schema,\n uint256 oldBalance,\n uint256 newBalance\n );\n\n /// @notice Event emitted when distribution configuration is updated\n event DistributionConfigUpdated(\n address indexed destination,\n uint16 oldPercentage,\n uint16 newPercentage,\n Schema schema\n );\n\n /// @notice Event emitted when distribution configuration is added\n event DistributionConfigAdded(address indexed destination, uint16 percentage, Schema schema);\n\n /// @notice Event emitted when distribution configuration is removed\n event DistributionConfigRemoved(address indexed destination, uint16 percentage, Schema schema);\n\n /**\n * @dev Constructor to initialize the immutable variables\n * @param _corePoolComptroller The address of core pool comptroller\n * @param _wbnb The address of WBNB\n * @param _vbnb The address of vBNB\n */\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address _corePoolComptroller,\n address _wbnb,\n address _vbnb\n ) {\n ensureNonzeroAddress(_corePoolComptroller);\n ensureNonzeroAddress(_wbnb);\n ensureNonzeroAddress(_vbnb);\n\n CORE_POOL_COMPTROLLER = _corePoolComptroller;\n WBNB = _wbnb;\n vBNB = _vbnb;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /**\n * @dev Initializes the deployer to owner.\n * @param _accessControlManager The address of ACM contract\n * @param _loopsLimit Limit for the loops in the contract to avoid DOS\n */\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n __AccessControlled_init(_accessControlManager);\n __ReentrancyGuard_init();\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @dev Pool registry setter.\n * @param _poolRegistry Address of the pool registry\n * @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n */\n function setPoolRegistry(address _poolRegistry) external onlyOwner {\n ensureNonzeroAddress(_poolRegistry);\n emit PoolRegistryUpdated(poolRegistry, _poolRegistry);\n poolRegistry = _poolRegistry;\n }\n\n /**\n * @dev Add or update destination targets based on destination address\n * @param configs configurations of the destinations.\n */\n function addOrUpdateDistributionConfigs(DistributionConfig[] calldata configs) external nonReentrant {\n _checkAccessAllowed(\"addOrUpdateDistributionConfigs(DistributionConfig[])\");\n\n for (uint256 i = 0; i < configs.length; ) {\n DistributionConfig memory _config = configs[i];\n ensureNonzeroAddress(_config.destination);\n\n bool updated = false;\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 j = 0; j < distributionTargetsLength; ) {\n DistributionConfig storage config = distributionTargets[j];\n\n if (_config.schema == config.schema && config.destination == _config.destination) {\n emit DistributionConfigUpdated(\n _config.destination,\n config.percentage,\n _config.percentage,\n _config.schema\n );\n config.percentage = _config.percentage;\n updated = true;\n break;\n }\n\n unchecked {\n ++j;\n }\n }\n\n if (!updated) {\n distributionTargets.push(_config);\n emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);\n }\n\n unchecked {\n ++i;\n }\n }\n\n _ensurePercentages();\n _ensureMaxLoops(distributionTargets.length);\n }\n\n /**\n * @dev Remove destionation target if percentage is 0\n * @param schema schema of the configuration\n * @param destination destination address of the configuration\n */\n function removeDistributionConfig(Schema schema, address destination) external {\n _checkAccessAllowed(\"removeDistributionConfig(Schema,address)\");\n\n uint256 distributionIndex;\n bool found = false;\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig storage config = distributionTargets[i];\n\n if (schema == config.schema && destination == config.destination && config.percentage == 0) {\n found = true;\n distributionIndex = i;\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n\n if (found) {\n emit DistributionConfigRemoved(\n distributionTargets[distributionIndex].destination,\n distributionTargets[distributionIndex].percentage,\n distributionTargets[distributionIndex].schema\n );\n\n distributionTargets[distributionIndex] = distributionTargets[distributionTargets.length - 1];\n distributionTargets.pop();\n }\n\n _ensurePercentages();\n }\n\n /**\n * @dev Release funds\n * @param comptroller the comptroller address of the pool\n * @param assets assets to be released to distribution targets\n */\n function releaseFunds(address comptroller, address[] calldata assets) external nonReentrant {\n for (uint256 i = 0; i < assets.length; ) {\n _releaseFund(comptroller, assets[i]);\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Used to find out the amount of funds that's going to be released when release funds is called.\n * @param comptroller the comptroller address of the pool\n * @param schema the schema of the distribution target\n * @param destination the destination address of the distribution target\n * @param asset the asset address which will be released\n */\n function getUnreleasedFunds(\n address comptroller,\n Schema schema,\n address destination,\n address asset\n ) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig storage _config = distributionTargets[i];\n if (_config.schema == schema && _config.destination == destination) {\n uint256 total = assetsReserves[comptroller][asset][schema];\n return (total * _config.percentage) / MAX_PERCENT;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Returns the total number of distribution targets\n */\n function totalDistributions() external view returns (uint256) {\n return distributionTargets.length;\n }\n\n /**\n * @dev Used to find out the percentage distribution for a particular destination based on schema\n * @param destination the destination address of the distribution target\n * @param schema the schema of the distribution target\n * @return percentage percentage distribution\n */\n function getPercentageDistribution(address destination, Schema schema) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n\n if (config.destination == destination && config.schema == schema) {\n return config.percentage;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\n * @param comptroller Comptroller address (pool)\n * @param asset Asset address.\n * @param incomeType type of income\n */\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) public override(IProtocolShareReserve) nonReentrant {\n if (!IComptroller(comptroller).isComptroller()) revert InvalidAddress();\n ensureNonzeroAddress(asset);\n\n if (\n comptroller != CORE_POOL_COMPTROLLER &&\n IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) == address(0)\n ) revert InvalidAddress();\n\n Schema schema = _getSchema(incomeType);\n uint256 currentBalance = IERC20Upgradeable(asset).balanceOf(address(this));\n uint256 assetReserve = totalAssetReserve[asset];\n\n if (currentBalance > assetReserve) {\n uint256 balanceDifference;\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n\n assetsReserves[comptroller][asset][schema] += balanceDifference;\n totalAssetReserve[asset] += balanceDifference;\n emit AssetsReservesUpdated(comptroller, asset, balanceDifference, incomeType, schema);\n }\n }\n\n /**\n * @dev asset from a particular pool to be release to distribution targets\n * @param comptroller Comptroller address(pool)\n * @param asset Asset address.\n */\n function _releaseFund(address comptroller, address asset) internal {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint256[] memory schemaBalances = new uint256[](totalSchemas);\n uint256 totalBalance;\n for (uint256 schemaValue; schemaValue < totalSchemas; ) {\n schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];\n totalBalance += schemaBalances[schemaValue];\n\n unchecked {\n ++schemaValue;\n }\n }\n\n if (totalBalance == 0) {\n return;\n }\n\n uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig memory _config = distributionTargets[i];\n\n uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;\n totalTransferAmounts[uint256(_config.schema)] += transferAmount;\n\n if (transferAmount != 0) {\n IERC20Upgradeable(asset).safeTransfer(_config.destination, transferAmount);\n IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);\n\n emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);\n }\n\n unchecked {\n ++i;\n }\n }\n\n uint256[] memory newSchemaBalances = new uint256[](totalSchemas);\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];\n assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];\n totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];\n\n emit ReservesUpdated(\n comptroller,\n asset,\n Schema(schemaValue),\n schemaBalances[schemaValue],\n newSchemaBalances[schemaValue]\n );\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the schema based on income type\n * @param incomeType type of income\n * @return schema schema for distribution\n */\n function _getSchema(IncomeType incomeType) internal view returns (Schema schema) {\n schema = Schema.ADDITIONAL_REVENUE;\n\n if (incomeType == IncomeType.SPREAD) {\n schema = Schema.PROTOCOL_RESERVES;\n }\n }\n\n /**\n * @dev This ensures that the total percentage of all the distribution targets is 100% or 0%\n */\n function _ensurePercentages() internal view {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint16[] memory totalPercentages = new uint16[](totalSchemas);\n\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n totalPercentages[uint256(config.schema)] += config.percentage;\n\n unchecked {\n ++i;\n }\n }\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)\n revert InvalidTotalPercentage();\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the underlying asset address for the vToken\n * @param vToken vToken address\n * @return asset address of asset\n */\n function _getUnderlying(address vToken) internal view returns (address) {\n if (vToken == vBNB) {\n return WBNB;\n } else {\n return IVToken(vToken).underlying();\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/RiskFundStorage.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { Ownable2StepUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n/// @title ReserveHelpersStorage\n/// @author Venus\n/// @dev Reserve helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ReserveHelpersStorage is Ownable2StepUpgradeable {\n /// @notice Deprecated slot for assetReserves mapping\n bytes32 private __deprecatedSlot1;\n\n /// @notice Available asset's fund per pool in RiskFund\n /// Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolAssetsFunds;\n\n /// @notice Deprecated slot for poolRegistry address\n bytes32 private __deprecatedSlot2;\n /// @notice Deprecated slot for status variable\n bytes32 private __deprecatedSlot3;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n uint256[46] private __gap;\n}\n\n/// @title MaxLoopsLimitHelpersStorage\n/// @author Venus\n/// @dev Max loop limit helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract MaxLoopsLimitHelpersStorage {\n /// @notice Limit for the loops to avoid the DOS\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 public maxLoopsLimit;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[49] private __gap;\n}\n\n/// @title RiskFundV1Storage\n/// @author Venus\n/// @dev Risk fund V1 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV1Storage is ReserveHelpersStorage, MaxLoopsLimitHelpersStorage {\n /// @notice Address of base asset\n address public convertibleBaseAsset;\n /// @notice Address of shortfall contract\n address public shortfall;\n\n /// @notice This state is deprecated, using it to prevent storage collision\n address private pancakeSwapRouter;\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 private minAmountToConvert;\n}\n\n/// @title RiskFundV2Storage\n/// @author Venus\n/// @dev Risk fund V2 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2Storage is RiskFundV1Storage, ReentrancyGuardUpgradeable {\n /// @notice Risk fund converter address\n address public riskFundConverter;\n}\n" + }, + "contracts/ProtocolReserve/RiskFundV2.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IRiskFund } from \"../Interfaces/IRiskFund.sol\";\nimport { IRiskFundConverter } from \"../Interfaces/IRiskFundConverter.sol\";\nimport { RiskFundV2Storage } from \"./RiskFundStorage.sol\";\n\n/// @title RiskFundV2\n/// @author Venus\n/// @notice Contract with basic features to hold base asset for different Comptrollers\n/// @dev This contract does not support BNB\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2 is AccessControlledV8, RiskFundV2Storage, IRiskFund {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Emitted when convertible base asset address is updated\n event ConvertibleBaseAssetUpdated(address indexed oldConvertibleBaseAsset, address indexed newConvertibleBaseAsset);\n\n /// @notice Emitted when risk fund converter address is updated\n event RiskFundConverterUpdated(address indexed oldRiskFundConverter, address indexed newRiskFundConverter);\n\n /// @notice Emitted when shortfall contract address is updated\n event ShortfallContractUpdated(address indexed oldShortfallContract, address indexed newShortfallContract);\n\n /// @notice Emitted when reserves are transferred for auction\n event TransferredReserveForAuction(address indexed comptroller, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred to this contract\n event PoolAssetsIncreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred from this contract on sweeping tokens\n event PoolAssetsDecreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Event emitted when tokens are swept and transferred from pool\n event SweepTokenFromPool(address indexed token, address indexed comptroller, uint256 amount);\n\n /// @notice Error is thrown when updatePoolState is not called by riskFundConverter\n error InvalidRiskFundConverter();\n\n /// @notice Error is thrown when transferReserveForAuction is called by non shortfall address\n error InvalidShortfallAddress();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice Error is thrown when pool reserve is less than the amount needed\n error InsufficientPoolReserve(address comptroller, uint256 amount, uint256 poolReserve);\n\n /// @dev Convertible base asset setter\n /// @param convertibleBaseAsset_ Address of the convertible base asset\n /// @custom:event ConvertibleBaseAssetUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when convertible base asset address is zero\n /// @custom:access Only Governance\n function setConvertibleBaseAsset(address convertibleBaseAsset_) external onlyOwner {\n ensureNonzeroAddress(convertibleBaseAsset_);\n emit ConvertibleBaseAssetUpdated(convertibleBaseAsset, convertibleBaseAsset_);\n convertibleBaseAsset = convertibleBaseAsset_;\n }\n\n /// @dev Risk fund converter setter\n /// @param riskFundConverter_ Address of the risk fund converter\n /// @custom:event RiskFundConverterUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when risk fund converter address is zero\n /// @custom:access Only Governance\n function setRiskFundConverter(address riskFundConverter_) external onlyOwner {\n ensureNonzeroAddress(riskFundConverter_);\n emit RiskFundConverterUpdated(riskFundConverter, riskFundConverter_);\n riskFundConverter = riskFundConverter_;\n }\n\n /// @dev Shortfall contract address setter\n /// @param shortfallContractAddress_ Address of the auction contract\n /// @custom:event ShortfallContractUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when shortfall contract address is zero\n /// @custom:access Only Governance\n function setShortfallContractAddress(address shortfallContractAddress_) external onlyOwner {\n ensureNonzeroAddress(shortfallContractAddress_);\n emit ShortfallContractUpdated(shortfall, shortfallContractAddress_);\n shortfall = shortfallContractAddress_;\n }\n\n /// @dev Transfer tokens for auction to shortfall contract\n /// @param comptroller Comptroller of the pool\n /// @param amount Amount to be transferred to the shortfall\n /// @return Amount of tokens transferred to the shortfall\n /// @custom:event TransferredReserveForAuction emit on success\n /// @custom:error InvalidShortfallAddress is thrown when caller is not shortfall contract\n /// @custom:error InsufficientPoolReserve is thrown when pool reserve is less than the amount needed\n /// @custom:access Only Shortfall contract\n function transferReserveForAuction(address comptroller, uint256 amount)\n external\n override\n nonReentrant\n returns (uint256)\n {\n uint256 poolReserve = poolAssetsFunds[comptroller][convertibleBaseAsset];\n\n if (msg.sender != shortfall) {\n revert InvalidShortfallAddress();\n }\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][convertibleBaseAsset] = poolReserve - amount;\n }\n\n IERC20Upgradeable(convertibleBaseAsset).safeTransfer(shortfall, amount);\n emit TransferredReserveForAuction(comptroller, amount);\n\n return amount;\n }\n\n /// @notice Function to sweep baseAsset for pool, Tokens are sent to address(to)\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep for the pool\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice Function to sweep token from pool\n /// @param tokenAddress Address of the asset(token)\n /// @param comptroller Pool address to which assets will be transferred\n /// @param amount Amount need to sweep from the pool\n /// @custom:event Emits sweepTokenFromPool event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/comptroller address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepTokenFromPool(\n address tokenAddress,\n address comptroller,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(comptroller);\n ensureNonzeroValue(amount);\n\n uint256 poolReserve = poolAssetsFunds[comptroller][tokenAddress];\n\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][tokenAddress] = poolReserve - amount;\n }\n\n IERC20Upgradeable(tokenAddress).safeTransfer(comptroller, amount);\n\n emit SweepTokenFromPool(tokenAddress, comptroller, amount);\n }\n\n /**\n * @notice Get the Amount of the Base asset in the risk fund for the specific pool.\n * @param comptroller Comptroller address(pool).\n * @return Base Asset's reserve in risk fund.\n */\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256) {\n return poolAssetsFunds[comptroller][convertibleBaseAsset];\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// @param comptroller Comptroller address (pool)\n /// @param asset Address of the asset(token)\n /// @param amount Amount transferred for the pool\n /// @custom:event PoolAssetsIncreased emits on success\n /// @custom:error InvalidRiskFundConverter is thrown if caller is not riskFundConverter contract\n /// @custom:access Only RiskFundConverter contract\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) public {\n if (msg.sender != riskFundConverter) {\n revert InvalidRiskFundConverter();\n }\n\n poolAssetsFunds[comptroller][asset] += amount;\n emit PoolAssetsIncreased(comptroller, asset, amount);\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n function preSweepToken(address tokenAddress, uint256 amount) internal {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n\n address[] memory pools = IRiskFundConverter(riskFundConverter).getPools(tokenAddress);\n\n uint256 assetReserves;\n uint256 poolsLength = pools.length;\n for (uint256 i; i < poolsLength; ) {\n assetReserves += poolAssetsFunds[pools[i]][tokenAddress];\n unchecked {\n ++i;\n }\n }\n\n uint256 balanceDiff = balance - assetReserves;\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n uint256 distributedShare;\n for (uint256 i; i < poolsLength; ) {\n if (poolAssetsFunds[pools[i]][tokenAddress] != 0) {\n uint256 poolAmountShare;\n if (i < (poolsLength - 1)) {\n poolAmountShare = (poolAssetsFunds[pools[i]][tokenAddress] * amount) / assetReserves;\n distributedShare += poolAmountShare;\n } else {\n poolAmountShare = amountDiff - distributedShare;\n }\n poolAssetsFunds[pools[i]][tokenAddress] -= poolAmountShare;\n emit PoolAssetsDecreased(pools[i], tokenAddress, poolAmountShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/XVSVaultTreasury.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IXVSVault } from \"../Interfaces/IXVSVault.sol\";\n\n/// @title XVSVaultTreasury\n/// @author Venus\n/// @notice XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract XVSVaultTreasury is AccessControlledV8, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice The xvs token address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable XVS_ADDRESS;\n\n /// @notice The xvsvault address\n address public xvsVault;\n\n /// @notice Emitted when XVS vault address is updated\n event XVSVaultUpdated(address indexed oldXVSVault, address indexed newXVSVault);\n\n /// @notice Emitted when funds transferred to XVSStore address\n event FundsTransferredToXVSStore(address indexed xvsStore, uint256 amountMantissa);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Thrown when given input amount is zero\n error InsufficientBalance();\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n /// @param xvsAddress_ XVS token address\n constructor(address xvsAddress_) {\n ensureNonzeroAddress(xvsAddress_);\n XVS_ADDRESS = xvsAddress_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param xvsVault_ XVSVault address\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function initialize(address accessControlManager_, address xvsVault_) public initializer {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n _setXVSVault(xvsVault_);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function setXVSVault(address xvsVault_) external onlyOwner {\n _setXVSVault(xvsVault_);\n }\n\n /// @notice This function transfers funds to the XVS vault\n /// @param amountMantissa Amount to be sent to XVS vault\n /// @custom:event FundsTransferredToXVSStore emits on success\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n /// @custom:access Restricted by ACM\n function fundXVSVault(uint256 amountMantissa) external nonReentrant {\n _checkAccessAllowed(\"fundXVSVault(uint256)\");\n ensureNonzeroValue(amountMantissa);\n\n uint256 balance = IERC20Upgradeable(XVS_ADDRESS).balanceOf(address(this));\n\n if (balance < amountMantissa) {\n revert InsufficientBalance();\n }\n\n address xvsStore = IXVSVault(xvsVault).xvsStore();\n ensureNonzeroAddress(xvsStore);\n IERC20Upgradeable(XVS_ADDRESS).safeTransfer(xvsStore, amountMantissa);\n\n emit FundsTransferredToXVSStore(xvsStore, amountMantissa);\n }\n\n /// @notice Function to sweep tokens from the contract\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep from the contract\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function _setXVSVault(address xvsVault_) internal {\n ensureNonzeroAddress(xvsVault_);\n emit XVSVaultUpdated(xvsVault, xvsVault_);\n xvsVault = xvsVault_;\n }\n}\n" + }, + "contracts/Test/imports.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n// This file is needed to make hardhat and typechain generate artifacts for\n// contracts we depend on (e.g. in tests or deployments) but not use directly.\n// Another way to do this would be to use hardhat-dependency-compiler, but\n// since we only have a couple of dependencies, installing a separate package\n// seems an overhead.\n\nimport { UpgradeableBeacon } from \"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\";\nimport { BeaconProxy } from \"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\n" + }, + "contracts/Test/Mocks/MockACM.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControl } from \"@openzeppelin/contracts/access/AccessControl.sol\";\n\ncontract MockACM is AccessControl {\n /// @notice Emitted when an account is given a permission to a certain contract function\n /// @dev If contract address is 0x000..0 this means that the account is a default admin of this function and\n /// can call any contract function with this signature\n event PermissionGranted(address account, address contractAddress, string functionSig);\n\n /// @notice Emitted when an account is revoked a permission to a certain contract function\n event PermissionRevoked(address account, address contractAddress, string functionSig);\n\n constructor() {\n // Grant the contract deployer the default admin role: it will be able\n // to grant and revoke any roles\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n }\n\n /**\n * @notice Gives a function call permission to one single account\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * @param contractAddress address of contract for which call permissions will be granted\n * @dev if contractAddress is zero address, the account can access the specified function\n * on **any** contract managed by this ACL\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @param accountToPermit account that will be given access to the contract function\n * @custom:event Emits a {RoleGranted} and {PermissionGranted} events.\n */\n function giveCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToPermit\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n grantRole(role, accountToPermit);\n emit PermissionGranted(accountToPermit, contractAddress, functionSig);\n }\n\n /**\n * @notice Revokes an account's permission to a particular function call\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * \t\tMay emit a {RoleRevoked} event.\n * @param contractAddress address of contract for which call permissions will be revoked\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @custom:event Emits {RoleRevoked} and {PermissionRevoked} events.\n */\n function revokeCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToRevoke\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n revokeRole(role, accountToRevoke);\n emit PermissionRevoked(accountToRevoke, contractAddress, functionSig);\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev Since restricted contracts using this function as a permission hook, we can get contracts address with msg.sender\n * @param account for which call permissions will be checked\n * @param functionSig restricted function signature e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n *\n */\n function isAllowedToCall(address account, string memory functionSig) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(msg.sender, functionSig));\n\n if (hasRole(role, account)) {\n return true;\n } else {\n role = keccak256(abi.encodePacked(address(0), functionSig));\n return hasRole(role, account);\n }\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev This function is used as a view function to check permissions rather than contract hook for access restriction check.\n * @param account for which call permissions will be checked against\n * @param contractAddress address of the restricted contract\n * @param functionSig signature of the restricted function e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n */\n function hasPermission(\n address account,\n address contractAddress,\n string memory functionSig\n ) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n return hasRole(role, account);\n }\n}\n" + }, + "contracts/Test/Mocks/MockArraySorter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\nimport { sort } from \"../../Utils/ArrayHelpers.sol\";\n\ncontract MockArraySorter {\n function sortArray(uint256[] memory balances, address[] memory addrs)\n external\n view\n returns (address[] memory, uint256[] memory)\n {\n sort(balances, addrs);\n return (addrs, balances);\n }\n}\n" + }, + "contracts/Test/Mocks/MockConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\n\nimport { AbstractTokenConverter } from \"../../TokenConverter/AbstractTokenConverter.sol\";\nimport { IRiskFundGetters } from \"../../Interfaces/IRiskFund.sol\";\n\ncontract MockConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) public assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolsAssetsReserves;\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n function mockPrivateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 balanceDiff\n ) external {\n _privateConversion(comptroller, tokenAddressOut, balanceDiff);\n }\n\n function AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) public initializer {\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n assetsReserves[tokenAddressIn] += convertedTokenInBalance;\n poolsAssetsReserves[comptroller][tokenAddressIn] += convertedTokenInBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @notice Get base asset address\n function _getDestinationBaseAsset() internal view override returns (address) {\n return IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/Test/Mocks/MockDeflationaryToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\ncontract MockDeflatingToken {\n string public constant NAME = \"Deflating Test Token\";\n string public constant SYMBOL = \"DTT\";\n uint8 public constant DECIMALS = 18;\n uint256 public totalSupply;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n bytes32 public immutable DOMAIN_SEPARATOR;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint256) public nonces;\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(uint256 _totalSupply) {\n uint256 chainId;\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = keccak256(\n abi.encode(\n keccak256(\"EIP712Domain(string NAME,string version,uint256 chainId,address verifyingContract)\"),\n keccak256(bytes(NAME)),\n keccak256(bytes(\"1\")),\n chainId,\n address(this)\n )\n );\n _mint(msg.sender, _totalSupply);\n }\n\n function approve(address spender, uint256 value) external returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\n }\n\n function transfer(address to, uint256 value) external returns (bool) {\n _transfer(msg.sender, to, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max) {\n allowance[from][msg.sender] = allowance[from][msg.sender] - value;\n }\n _transfer(from, to, value);\n return true;\n }\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 require(deadline >= block.timestamp, \"EXPIRED\");\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR,\n keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, \"INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n\n function _mint(address to, uint256 value) internal {\n totalSupply = totalSupply + value;\n balanceOf[to] = balanceOf[to] + value;\n emit Transfer(address(0), to, value);\n }\n\n function _burn(address from, uint256 value) internal {\n balanceOf[from] = balanceOf[from] - value;\n totalSupply = totalSupply - value;\n emit Transfer(from, address(0), value);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value\n ) private {\n allowance[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 value\n ) private {\n uint256 burnAmount = value / 100;\n _burn(from, burnAmount);\n uint256 transferAmount = value - burnAmount;\n balanceOf[from] = balanceOf[from] - transferAmount;\n balanceOf[to] = balanceOf[to] + transferAmount;\n emit Transfer(from, to, transferAmount);\n }\n}\n" + }, + "contracts/Test/Mocks/MockRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { RiskFundConverter } from \"../../TokenConverter/RiskFundConverter.sol\";\n\ncontract MockRiskFundConverter is RiskFundConverter {\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) RiskFundConverter(corePoolComptroller_, vBNB_, nativeWrapped_) {}\n\n function postConversionHookMock(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) external {\n super._postConversionHook(tokenInAddress, tokenOutAddress, amountIn, amountOut);\n }\n\n function preTransferHookMock(address tokenOutAddress, uint256 amountOut) external {\n super._preTransferHook(tokenOutAddress, amountOut);\n }\n\n function setAssetsReserves(address asset, uint256 amount) external {\n assetsReserves[asset] = amount;\n }\n\n function setPoolsAssetsReserves(\n address comptroller,\n address asset,\n uint256 amount\n ) external {\n poolsAssetsReserves[comptroller][asset] = amount;\n }\n\n function getPoolsAssetsReserves(address comptroller, address asset) external view returns (uint256) {\n return poolsAssetsReserves[comptroller][asset];\n }\n\n function getAssetsReserves(address asset) external view returns (uint256) {\n return assetsReserves[asset];\n }\n}\n" + }, + "contracts/Test/Mocks/MockToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)\n\npragma solidity 0.8.25;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract MockToken is ERC20 {\n uint8 private immutable _decimals;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_\n ) ERC20(name_, symbol_) {\n _decimals = decimals_;\n }\n\n function faucet(uint256 amount) external {\n _mint(msg.sender, amount);\n }\n\n function allocateTo(address owner, uint256 amount) external {\n _mint(owner, amount);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "contracts/TokenConverter/AbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\nimport { MANTISSA_ONE, EXP_SCALE } from \"@venusprotocol/solidity-utilities/contracts/constants.sol\";\n\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title AbstractTokenConverter\n/// @author Venus\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\n/*\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\n *\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\n * a. convertExactTokensSupportingFeeOnTransferTokens\n * b. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\n * similar to Case I.\n *\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * a. convertExactTokens\n * b. convertForExactTokens\n * c. convertExactTokensSupportingFeeOnTransferTokens\n * d. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * similar to Case III.\n *\n * ------------------------------------------------------------------------------------------------------------------------------------\n * Example 1:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInAmount - 100\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\n * function for tokenIn as deflationary token.\n *\n * Example 2:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\n * tokenOutAmount - 70\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\n * ------------------------------------------------------------------------------------------------------------------------------------\n *\n * This contract also supports private conversion between the converters:\n * Private conversions:\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\n *\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\n *\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\n * tokenAddressOut: As base asset of that converter.\n *\n * ConverterNetwork:\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\n * and tokenAddressOut provided.\n *\n * findTokenConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\n *\n * findTokenConvertersForConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\n */\n\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Maximum incentive could be\n uint256 public constant MAX_INCENTIVE = 0.5e18;\n\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\n uint256 public minAmountToConvert;\n\n /// @notice Venus price oracle contract\n ResilientOracle public priceOracle;\n\n /// @notice conversion configurations for the existing pairs\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\n\n /// @notice Address that all incoming tokens are transferred to\n address public destinationAddress;\n\n /// @notice Boolean for if conversion is paused\n bool public conversionPaused;\n\n /// @notice Address of the converterNetwork contract\n IConverterNetwork public converterNetwork;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[45] private __gap;\n\n /// @notice Emitted when config is updated for tokens pair\n event ConversionConfigUpdated(\n address indexed tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 oldIncentive,\n uint256 newIncentive,\n ConversionAccessibility oldAccess,\n ConversionAccessibility newAccess\n );\n /// @notice Emitted when price oracle address is updated\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\n\n /// @notice Emitted when destination address is updated\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\n\n /// @notice Emitted when converterNetwork address is updated\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\n\n /// @notice Emitted when exact amount of tokens are converted for tokens\n event ConvertedExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens\n event ConvertedForExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when conversion is paused\n event ConversionPaused(address indexed sender);\n\n /// @notice Emitted when conversion is unpaused\n event ConversionResumed(address indexed sender);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Emitted when minimum amount to convert is updated\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\n\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\n error AmountOutMismatched();\n\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\n error AmountInMismatched();\n\n /// @notice Thrown when given input amount is zero\n error InsufficientInputAmount();\n\n /// @notice Thrown when given output amount is zero\n error InsufficientOutputAmount();\n\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\n error ConversionConfigNotEnabled();\n\n /// @notice Thrown when conversion is enabled only for private conversions\n error ConversionEnabledOnlyForPrivateConversions();\n\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n error InvalidToAddress();\n\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\n\n /// @notice Thrown when amountOut is lower than amountOutMin\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\n\n /// @notice Thrown when amountIn is higher than amountInMax\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\n\n /// @notice Thrown when conversion is paused\n error ConversionTokensPaused();\n\n /// @notice Thrown when conversion is Active\n error ConversionTokensActive();\n\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\n error InvalidTokenConfigAddresses();\n\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\n error InsufficientPoolLiquidity();\n\n /// @notice When address of the ConverterNetwork is not set or Zero address\n error InvalidConverterNetwork();\n\n /// @notice Thrown when trying to set non zero incentive for private conversion\n error NonZeroIncentiveForPrivateConversion();\n\n /// @notice Thrown when using convertForExactTokens deflationary tokens\n error DeflationaryTokenNotSupported();\n\n /// @notice Thrown when minimum amount to convert is zero\n error InvalidMinimumAmountToConvert();\n\n /// @notice Thrown when there is a mismatch in the length of input arrays\n error InputLengthMisMatch();\n\n /**\n * @notice Modifier to ensure valid conversion parameters for a token conversion\n * and check if conversion is paused or not\n * @param to The recipient address for the converted tokens\n * @param tokenAddressIn The input token address for the conversion\n * @param tokenAddressOut The output token address for the conversion\n */\n modifier validConversionParameters(\n address to,\n address tokenAddressIn,\n address tokenAddressOut\n ) {\n _checkConversionPaused();\n ensureNonzeroAddress(to);\n if (to == tokenAddressIn || to == tokenAddressOut) {\n revert InvalidToAddress();\n }\n _;\n }\n\n /// @notice Pause conversion of tokens\n /// @custom:event Emits ConversionPaused on success\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\n /// @custom:access Restricted by ACM\n function pauseConversion() external {\n _checkAccessAllowed(\"pauseConversion()\");\n _checkConversionPaused();\n conversionPaused = true;\n emit ConversionPaused(msg.sender);\n }\n\n /// @notice Resume conversion of tokens.\n /// @custom:event Emits ConversionResumed on success\n /// @custom:error ConversionTokensActive thrown when conversion is already active\n /// @custom:access Restricted by ACM\n function resumeConversion() external {\n _checkAccessAllowed(\"resumeConversion()\");\n if (!conversionPaused) {\n revert ConversionTokensActive();\n }\n\n conversionPaused = false;\n emit ConversionResumed(msg.sender);\n }\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:access Only Governance\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\n _setPriceOracle(priceOracle_);\n }\n\n /// @notice Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:access Only Governance\n function setDestination(address destinationAddress_) external onlyOwner {\n _setDestination(destinationAddress_);\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:access Only Governance\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\n _setConverterNetwork(converterNetwork_);\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:access Only Governance\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\n _checkAccessAllowed(\"setMinAmountToConvert(uint256)\");\n _setMinAmountToConvert(minAmountToConvert_);\n }\n\n /// @notice Batch sets the conversion configurations\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressesOut Array of addresses of tokenOut\n /// @param conversionConfigs Array of conversionConfig config details to update\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\n function setConversionConfigs(\n address tokenAddressIn,\n address[] calldata tokenAddressesOut,\n ConversionConfig[] calldata conversionConfigs\n ) external {\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\n\n for (uint256 i; i < tokenOutArrayLength; ) {\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountIn != amountInMantissa) {\n revert AmountInMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\n /// otherwise the amount is adjusted\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountOut != amountOutMantissa) {\n revert AmountOutMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\n /// @param tokenAddress The address of the ERC-20 token to sweep\n /// @param to The address to which tokens will be transferred\n /// @param amount The amount to transfer\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\n /// @dev This function retrieves values without altering token prices\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n amountConvertedMantissa = amountInMantissa;\n uint256 tokenInToOutConversion;\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountConvertedMantissa = _divRoundingUp(maxTokenOutReserve * EXP_SCALE, tokenInToOutConversion);\n amountOutMantissa = maxTokenOutReserve;\n }\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @dev This function retrieves values without altering token prices\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountOutMantissa = maxTokenOutReserve;\n }\n\n amountConvertedMantissa = amountOutMantissa;\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountInMantissa;\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountOutMantissa;\n }\n\n /// @notice This method updated the states of this contract after getting funds from PSR\n /// after settling the amount(if any) through privateConversion between converters\n /// @dev This function is called by protocolShareReserve\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\n if (balanceDiff > 0) {\n _privateConversion(comptroller, asset, balanceDiff);\n }\n }\n\n /// @notice Set the configuration for new or existing conversion pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n /// @custom:event Emits ConversionConfigUpdated event on success\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\n /// @custom:access Controlled by AccessControlManager\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) public {\n _checkAccessAllowed(\"setConversionConfig(address,address,ConversionConfig)\");\n ensureNonzeroAddress(tokenAddressIn);\n ensureNonzeroAddress(tokenAddressOut);\n\n if (conversionConfig.incentive > MAX_INCENTIVE) {\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\n }\n\n if (\n (tokenAddressIn == tokenAddressOut) ||\n (tokenAddressIn != _getDestinationBaseAsset()) ||\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\n ) {\n revert InvalidTokenConfigAddresses();\n }\n\n if (\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\n conversionConfig.incentive != 0\n ) {\n revert NonZeroIncentiveForPrivateConversion();\n }\n\n if (\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\n (address(converterNetwork) == address(0))\n ) {\n revert InvalidConverterNetwork();\n }\n\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n emit ConversionConfigUpdated(\n tokenAddressIn,\n tokenAddressOut,\n configuration.incentive,\n conversionConfig.incentive,\n configuration.conversionAccess,\n conversionConfig.conversionAccess\n );\n\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\n } else {\n configuration.incentive = conversionConfig.incentive;\n configuration.conversionAccess = conversionConfig.conversionAccess;\n }\n }\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\n\n /// @dev Operations to perform before sweeping tokens\n /// @param token Address of the token\n /// @param amount Amount transferred to address(to)\n function preSweepToken(address token, uint256 amount) internal virtual {}\n\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function _convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n if (amountOutMantissa < amountOutMinMantissa) {\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n }\n\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\n /// it is called by convertForExactTokens function\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n if (actualAmountIn != amountInMantissa) {\n revert DeflationaryTokenNotSupported();\n }\n\n if (actualAmountIn > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n actualAmountOut = amountOutMantissa;\n }\n\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n if (amountInMantissa > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\n }\n\n /// @dev return actualAmountOut from reserves for tokenAddressOut\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\n function _doTransferOut(\n address tokenAddressOut,\n address to,\n uint256 amountConvertedMantissa\n ) internal {\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountConvertedMantissa) {\n revert InsufficientPoolLiquidity();\n }\n\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\n\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\n tokenOut.safeTransfer(to, amountConvertedMantissa);\n }\n\n /// @notice Transfer tokenAddressIn from user to destination\n /// @param tokenAddressIn Address of the token to convert\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @return actualAmountIn Actual amount transferred to destination\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\n }\n\n /// @dev Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:event Emits PriceOracleUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\n ensureNonzeroAddress(address(priceOracle_));\n emit PriceOracleUpdated(priceOracle, priceOracle_);\n priceOracle = priceOracle_;\n }\n\n /// @dev Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:event Emits DestinationAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\n function _setDestination(address destinationAddress_) internal {\n ensureNonzeroAddress(destinationAddress_);\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\n destinationAddress = destinationAddress_;\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\n ensureNonzeroAddress(address(converterNetwork_));\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\n converterNetwork = converterNetwork_;\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:event MinAmountToConvertUpdated is emitted in success\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\n ensureNonzeroValue(minAmountToConvert_);\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\n minAmountToConvert = minAmountToConvert_;\n }\n\n /// @dev Hook to perform after converting tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param amountIn Amount of tokenIn converted\n /// @param amountOut Amount of tokenOut converted\n function _postConversionHook(\n address tokenAddressIn,\n address tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n ) internal virtual {}\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init_unchained(\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n _setPriceOracle(priceOracle_);\n _setDestination(destinationAddress_);\n _setMinAmountToConvert(minAmountToConvert_);\n conversionPaused = false;\n }\n\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return Amount of asset, for _privateConversion\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\n\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\n /// destination contract as destination's base asset\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\n function _privateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 amountToConvert\n ) internal {\n address tokenAddressIn = _getDestinationBaseAsset();\n address _destinationAddress = destinationAddress;\n uint256 convertedTokenInBalance;\n if (address(converterNetwork) != address(0)) {\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\n uint256 convertersLength = converterAddresses.length;\n for (uint256 i; i < convertersLength; ) {\n if (converterBalances[i] == 0) break;\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\n converterBalances[i],\n tokenAddressOut,\n tokenAddressIn\n );\n if (amountIn > amountToConvert) {\n amountIn = amountToConvert;\n }\n\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\n break;\n }\n\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n\n IERC20Upgradeable(tokenAddressOut).forceApprove(converterAddresses[i], amountIn);\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\n amountIn,\n 0,\n tokenAddressOut,\n tokenAddressIn,\n _destinationAddress\n );\n\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n amountToConvert -= amountIn;\n convertedTokenInBalance += (balanceAfter - balanceBefore);\n\n if (amountToConvert == 0) break;\n unchecked {\n ++i;\n }\n }\n }\n\n _postPrivateConversionHook(\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance,\n tokenAddressOut,\n amountToConvert\n );\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal virtual {}\n\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\n\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\n /// @param amountIn The amount to convert\n /// @param tokenAddress Address of the token\n /// @return isValid true if amount to convert is greater than minimum amount to convert\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\n priceOracle.updateAssetPrice(tokenAddress);\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\n\n if (amountInInUsd >= minAmountToConvert) {\n isValid = true;\n }\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\n if (amountInMantissa == 0) {\n revert InsufficientInputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\n /// multiplied by conversionWithIncentive which will be >= 1\n amountOutMantissa = (amountInMantissa * tokenInToOutConversion) / (EXP_SCALE);\n }\n\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\n if (amountOutMantissa == 0) {\n revert InsufficientOutputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\n converterNetwork.isTokenConverter(msg.sender);\n if (isPrivateConversion) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\n if (isPrivateConversion) {\n amountInMantissa =\n (amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE) /\n (tokenInUnderlyingPrice * conversionWithIncentive);\n } else {\n amountInMantissa = _divRoundingUp(\n amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE,\n tokenInUnderlyingPrice * conversionWithIncentive\n );\n }\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n }\n\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\n if (\n (!(isConverter) &&\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n }\n\n /// @dev To check, is conversion paused\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\n function _checkConversionPaused() internal view {\n if (conversionPaused) {\n revert ConversionTokensPaused();\n }\n }\n\n /// @dev Get base asset address of the destination contract\n /// @return Address of the base asset\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\n\n /// @dev Performs division where the result is rounded up\n /// @param numerator The numerator of the division operation\n /// @param denominator The denominator of the division operation. Must be non-zero\n /// @return The result of the division, rounded up\n function _divRoundingUp(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\n return (numerator + denominator - 1) / denominator;\n }\n}\n" + }, + "contracts/TokenConverter/ConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { sort } from \"../Utils/ArrayHelpers.sol\";\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title ConverterNetwork\n/// @author Venus\n/// @notice ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ConverterNetwork is IConverterNetwork, AccessControlledV8, MaxLoopsLimitHelper {\n /// @notice Array holding all the converters\n IAbstractTokenConverter[] public allConverters;\n\n /// @notice Emitted when new converter is added\n event ConverterAdded(address indexed converter);\n\n /// @notice Emitted when converter is removed\n event ConverterRemoved(address indexed converter);\n\n /// @notice Error thrown when converter already exists\n error ConverterAlreadyExists();\n\n /// @notice Error thrown converter does not exist\n error ConverterDoesNotExist();\n\n /// @notice Error thrown when converter address is invalid\n error InvalidTokenConverterAddress();\n\n /// @notice Error thrown when loops limit is invalid\n error InvalidMaxLoopsLimit(uint256 loopsLimit);\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @notice ConverterNetwork initializer\n /// @param _accessControlManager The address of ACM contract\n /// @param _loopsLimit Limit for the loops in the contract to avoid DOS\n /// @custom:event ConverterAdded is emitted for each converter added on success\n /// @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n ensureNonzeroAddress(_accessControlManager);\n __AccessControlled_init(_accessControlManager);\n\n if (_loopsLimit >= type(uint128).max) revert InvalidMaxLoopsLimit(_loopsLimit);\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n * @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n * @custom:access Only owner\n */\n function setMaxLoopsLimit(uint256 limit) external onlyOwner {\n if (limit >= type(uint128).max) revert InvalidMaxLoopsLimit(limit);\n _setMaxLoopsLimit(limit);\n }\n\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:event ConverterAdded is emitted on success\n /// @custom:access Only Governance\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"addTokenConverter(address)\");\n _addTokenConverter(_tokenConverter);\n }\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterDoesNotExist is thrown when converter to remove does not exist\n /// @custom:event ConverterRemoved is emitted on success\n /// @custom:access Only Governance\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"removeTokenConverter(address)\");\n\n // Find the index of the converter in the array\n uint128 indexToRemove = _findConverterIndex(_tokenConverter);\n\n // Ensure that the converter exists in the array\n if (indexToRemove == type(uint128).max) revert ConverterDoesNotExist();\n\n // Swap the element to remove with the last element\n allConverters[indexToRemove] = allConverters[allConverters.length - 1];\n\n // Remove the last element (which is now a duplicate)\n allConverters.pop();\n\n emit ConverterRemoved(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to users for conversion\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, false);\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to converters for conversion.\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, true);\n }\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return converters Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory converters) {\n converters = allConverters;\n }\n\n /// @notice This function checks if the given address is a converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return isConverter true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool isConverter) {\n uint128 index = _findConverterIndex(IAbstractTokenConverter(_tokenConverter));\n\n if (index != type(uint128).max) {\n isConverter = true;\n }\n }\n\n /// @notice Adds new converter contract to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterAlreadyExists is thrown when new tokenconverter to add already exists\n /// @custom:event ConverterAdded is emitted on success\n function _addTokenConverter(IAbstractTokenConverter _tokenConverter) internal {\n if (\n (address(_tokenConverter) == address(0)) || (address(_tokenConverter.converterNetwork()) != address(this))\n ) {\n revert InvalidTokenConverterAddress();\n }\n\n uint128 index = _findConverterIndex(_tokenConverter);\n if (index != type(uint128).max) revert ConverterAlreadyExists();\n\n allConverters.push(_tokenConverter);\n _ensureMaxLoops(allConverters.length);\n\n emit ConverterAdded(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @param forConverters Bool to filter out converters on the basis of the conversionAccess\n /// @return converters Array of converters\n /// @return convertersBalance Array of balances with respect to token out\n function _findTokenConverters(\n address _tokenAddressIn,\n address _tokenAddressOut,\n bool forConverters\n ) internal returns (address[] memory converters, uint256[] memory convertersBalance) {\n uint128 convertersLength = uint128(allConverters.length);\n\n // Create a dynamic array to store the matching converters\n converters = new address[](convertersLength);\n convertersBalance = new uint256[](convertersLength);\n uint128 count;\n\n for (uint128 i; i < convertersLength; ) {\n IAbstractTokenConverter converter = allConverters[i];\n\n unchecked {\n ++i;\n }\n\n if ((address(converter.converterNetwork()) != address(this)) || msg.sender == address(converter)) {\n continue;\n }\n\n (, IAbstractTokenConverter.ConversionAccessibility conversionAccess) = converter.conversionConfigurations(\n _tokenAddressIn,\n _tokenAddressOut\n );\n\n if (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ALL) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n forConverters &&\n (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_CONVERTERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n !forConverters && (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_USERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n }\n }\n\n // Resize the array to the actual number of matching converters\n assembly {\n mstore(converters, count)\n mstore(convertersBalance, count)\n }\n sort(convertersBalance, converters);\n }\n\n /// @notice Used to get the index of the converter stored in the array\n /// This will return the index if the converter exists in the array otherwise will return type(uint128).max\n /// @param _tokenConverter Address of the token converter\n /// @return index of the converter address in the allConverters array\n function _findConverterIndex(IAbstractTokenConverter _tokenConverter) internal view returns (uint128 index) {\n index = type(uint128).max; // Not found, return a large value\n\n uint128 convertersLength = uint128(allConverters.length);\n for (uint128 i; i < convertersLength; ) {\n if (allConverters[i] == _tokenConverter) {\n index = i;\n }\n unchecked {\n ++i;\n }\n }\n }\n}\n" + }, + "contracts/TokenConverter/IAbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @notice Interface for AbstractTokenConverter\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ninterface IAbstractTokenConverter {\n /// @notice This enum define the all possible ways of conversion can happen\n enum ConversionAccessibility {\n NONE, // Conversion is disable for the pair\n ALL, // Conversion is enable for private conversion and users\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\n ONLY_FOR_USERS // Conversion is enable only for users\n }\n\n /// @notice This struct represents the configuration for a token conversion.\n struct ConversionConfig {\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\n uint256 incentive;\n /// enable or disable conversion for users or converters or both or none\n ConversionAccessibility conversionAccess;\n }\n\n /// @notice Pause conversion of tokens\n function pauseConversion() external;\n\n /// @notice Resume conversion of tokens.\n function resumeConversion() external;\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n function setPriceOracle(ResilientOracle priceOracle_) external;\n\n /// @notice Set the configuration for new or existing convert pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) external;\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Get the configuration for the pair of the tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\n /// @return conversionAccess Accessibility for the pair of tokens\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\n external\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\n\n /// @notice Get the address of the converterNetwork\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) external view returns (uint256 tokenBalance);\n}\n" + }, + "contracts/TokenConverter/RiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IRiskFund, IRiskFundGetters } from \"../Interfaces/IRiskFund.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\n\n/// @title RiskFundConverter\n/// @author Venus\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the core pool comptroller\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n ///@notice Address of the vBNB\n ///@dev This address is used to include the BNB market while in getPools method\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable VBNB;\n\n ///@notice Address of the native wrapped currency\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable NATIVE_WRAPPED;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) internal assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\n\n /// @notice Address of pool registry contract\n address public poolRegistry;\n\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\n\n // Error thrown when comptrollers array length is not equal to assets array length\n error InvalidArguments();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice thrown when asset does not exist in the pool\n error MarketNotExistInPool(address comptroller, address asset);\n\n /// @notice thrown to prevent reentrancy\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\n /// cannot be called recursively within the same transaction.\n error ReentrancyGuardError();\n\n /// @param corePoolComptroller_ Address of the Comptroller pool\n /// @param vBNB_ Address of the vBNB\n /// @param nativeWrapped_ Address of the wrapped native currency\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) {\n ensureNonzeroAddress(corePoolComptroller_);\n ensureNonzeroAddress(vBNB_);\n ensureNonzeroAddress(nativeWrapped_);\n\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\n VBNB = vBNB_;\n NATIVE_WRAPPED = nativeWrapped_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param poolRegistry_ Address of the pool registry\n /// @param minAmountToConvert_ minimum amount to convert\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address poolRegistry_,\n uint256 minAmountToConvert_,\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) public initializer {\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n ensureNonzeroAddress(poolRegistry_);\n poolRegistry = poolRegistry_;\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Pool registry setter\n /// @param poolRegistry_ Address of the pool registry\n /// @custom:event PoolRegistryUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:access Only Governance\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\n ensureNonzeroAddress(poolRegistry_);\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\n poolRegistry = poolRegistry_;\n }\n\n /// @notice Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:access Restricted by ACM\n function setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) external {\n _checkAccessAllowed(\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\");\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return reserves Asset's reserve in risk fund\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n reserves = poolsAssetsReserves[comptroller][asset];\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Reserves of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n tokenBalance = assetsReserves[tokenAddress];\n }\n\n /// @notice Get the array of all pools addresses\n /// @param tokenAddress Address of the token\n /// @return poolsWithCore Array of the pools addresses in which token is available\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\n\n if (isAssetListedInCore(tokenAddress)) {\n uint256 poolsLength = poolsWithCore.length;\n address[] memory extendedPools = new address[](poolsLength + 1);\n\n for (uint256 i; i < poolsLength; ) {\n extendedPools[i] = poolsWithCore[i];\n unchecked {\n ++i;\n }\n }\n\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\n poolsWithCore = extendedPools;\n }\n }\n\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\n assetsReserves[tokenOutAddress] -= amountOut;\n }\n\n /// @notice Hook to perform after converting tokens\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\n /// @param tokenInAddress Address of the tokenIn\n /// @param tokenOutAddress Address of the tokenOut\n /// @param amountIn Amount of tokenIn transferred\n /// @param amountOut Amount of tokenOut transferred\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\n function _postConversionHook(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) internal override {\n address[] memory pools = getPools(tokenOutAddress);\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\n ensureNonzeroValue(assetReserve);\n\n uint256 poolsLength = pools.length;\n uint256 distributedOutShare;\n uint256 poolAmountInShare;\n uint256 distributedInShare;\n\n for (uint256 i; i < poolsLength; ) {\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\n if (currentPoolsAssetsReserves != 0) {\n if (i < (poolsLength - 1)) {\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\n distributedInShare += poolAmountInShare;\n } else {\n uint256 distributedDiff = amountOut - distributedOutShare;\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\n poolAmountInShare = amountIn - distributedInShare;\n }\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n\n address[] memory pools = getPools(tokenAddress);\n uint256 assetReserve = assetsReserves[tokenAddress];\n uint256 poolsLength = pools.length;\n uint256 distributedShare;\n\n for (uint256 i; i < poolsLength; ) {\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\n if (i < (poolsLength - 1)) {\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\n } else {\n uint256 distributedDiff = amountDiff - distributedShare;\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\n }\n }\n unchecked {\n ++i;\n }\n }\n assetsReserves[tokenAddress] -= amountDiff;\n }\n }\n\n /// @dev Update the poolAssetsReserves upon transferring the tokens\n /// @param pool Address of the pool\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @param assetReserve Asset's reserve for the pool\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\n /// @custom:event AssetsReservesUpdated emits on success\n function updatePoolAssetsReserve(\n address pool,\n address tokenAddress,\n uint256 amount,\n uint256 assetReserve\n ) internal returns (uint256 poolAmountShare) {\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\n }\n\n /// @dev Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\n function _setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) internal {\n uint256 comptrollersLength = comptrollers.length;\n\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\n revert InvalidArguments();\n }\n\n for (uint256 i; i < comptrollersLength; ) {\n address[] memory poolAssets = assets[i];\n bool[] memory assetsValues = values[i];\n uint256 poolAssetsLength = poolAssets.length;\n\n if (poolAssetsLength != assetsValues.length) {\n revert InvalidArguments();\n }\n\n for (uint256 j; j < poolAssetsLength; ) {\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\n unchecked {\n ++j;\n }\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// and transferring funds to the protocol share reserve\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return balanceDifference Amount of asset, for _privateConversion\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n function _updateAssetsState(address comptroller, address asset)\n internal\n override\n returns (uint256 balanceDifference)\n {\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 currentBalance = token.balanceOf(address(this));\n uint256 assetReserve = assetsReserves[asset];\n if (currentBalance > assetReserve) {\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\n token.safeTransfer(destinationAddress, balanceDifference);\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\n\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\n IRiskFund(destinationAddress).updatePoolState(\n comptroller,\n asset,\n newDestinationBalance - previousDestinationBalance\n );\n balanceDifference = 0;\n }\n }\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n emit AssetTransferredToDestination(\n destinationAddress,\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance\n );\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @dev This function checks for the given asset is listed in core pool or not\n /// @param tokenAddress Address of the asset\n /// @return isAssetListed true if the asset is listed\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\n\n uint256 coreMarketsLength = coreMarkets.length;\n for (uint256 i; i < coreMarketsLength; ) {\n isAssetListed = (VBNB == coreMarkets[i])\n ? (tokenAddress == NATIVE_WRAPPED)\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\n\n if (isAssetListed) {\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev This function checks for the given asset is listed or not\n /// @param comptroller Address of the comptroller\n /// @param asset Address of the asset\n /// @return isListed true if the asset is listed\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\n if (comptroller == CORE_POOL_COMPTROLLER) {\n isListed = isAssetListedInCore(asset);\n } else {\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\n }\n }\n\n /// @dev Get base asset address of the RiskFund\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/TokenConverter/SingleTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\n\n/// @title SingleTokenConverter\n/// @author Venus\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract SingleTokenConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the base asset token\n address public baseAsset;\n\n /// @notice Emitted when base asset is updated\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param baseAsset_ Address of the base asset\n /// @param minAmountToConvert_ Minimum amount to convert\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address baseAsset_,\n uint256 minAmountToConvert_\n ) public initializer {\n _setBaseAsset(baseAsset_);\n\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @notice Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:access Only Governance\n function setBaseAsset(address baseAsset_) external onlyOwner {\n _setBaseAsset(baseAsset_);\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address.\n /// @return balanceLeft Amount of asset, for _privateConversion\n // solhint-disable-next-line\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 balance = token.balanceOf(address(this));\n balanceLeft = balance;\n\n if (asset == baseAsset) {\n balanceLeft = 0;\n token.safeTransfer(destinationAddress, balance);\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\n }\n }\n\n /// @dev Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n /// @custom:event BaseAssetUpdated is emitted on success\n function _setBaseAsset(address baseAsset_) internal {\n ensureNonzeroAddress(baseAsset_);\n emit BaseAssetUpdated(baseAsset, baseAsset_);\n baseAsset = baseAsset_;\n }\n\n /// @dev Get base asset address\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = baseAsset;\n }\n}\n" + }, + "contracts/Utils/ArrayHelpers.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\nfunction sort(uint256[] memory arr, address[] memory addrs) pure {\n if (arr.length > 1) {\n return quickSortDescending(arr, addrs, 0, arr.length - 1);\n }\n}\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\n/// @param left index of first value\n/// @param right index of last value\nfunction quickSortDescending(\n uint256[] memory arr,\n address[] memory addrs,\n uint256 left,\n uint256 right\n) pure {\n if (left >= right) return;\n uint256 p = arr[(left + right) / 2]; // p = the pivot element\n uint256 i = left;\n uint256 j = right;\n while (i < j) {\n while (arr[i] > p) ++i;\n while (arr[j] < p) --j; // arr[j] < p means p still to the right, so j > 0\n if (arr[i] < arr[j]) {\n (arr[i], arr[j]) = (arr[j], arr[i]);\n (addrs[i], addrs[j]) = (addrs[j], addrs[i]);\n } else {\n ++i;\n }\n }\n\n if (j > left) quickSortDescending(arr, addrs, left, j - 1); // j > left, so j > 0\n quickSortDescending(arr, addrs, j + 1, right);\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/yarn.lock b/yarn.lock index e87e6430..127922e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3544,42 +3544,7 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/protocol-reserve@npm:^1.1.0": - version: 1.5.0 - resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^1.3.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 - languageName: node - linkType: hard - -"@venusprotocol/protocol-reserve@npm:^2.0.0": - version: 2.3.0 - resolution: "@venusprotocol/protocol-reserve@npm:2.3.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^2.0.3 - "@venusprotocol/venus-protocol": ^9.1.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: b9e12702281d0790c0136f922400b5f90ff88d04d2af97580620a2677190c1957a4fdb38ff6600ff5e4f71e4d521c8bb013d7775814a2f68e3883544f38caa95 - languageName: node - linkType: hard - -"@venusprotocol/protocol-reserve@workspace:.": +"@venusprotocol/protocol-reserve@^2.0.0, @venusprotocol/protocol-reserve@workspace:.": version: 0.0.0-use.local resolution: "@venusprotocol/protocol-reserve@workspace:." dependencies: @@ -3647,6 +3612,23 @@ __metadata: languageName: unknown linkType: soft +"@venusprotocol/protocol-reserve@npm:^1.1.0": + version: 1.5.0 + resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" + dependencies: + "@nomiclabs/hardhat-ethers": ^2.2.3 + "@openzeppelin/contracts": ^4.8.3 + "@openzeppelin/contracts-upgradeable": ^4.8.3 + "@openzeppelin/hardhat-upgrades": ^1.21.0 + "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/solidity-utilities": ^1.3.0 + ethers: ^5.7.0 + hardhat-deploy: ^0.11.14 + module-alias: ^2.2.2 + checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 + languageName: node + linkType: hard + "@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0": version: 2.0.0 resolution: "@venusprotocol/solidity-utilities@npm:2.0.0" From 9054a09a9111b9b32b1f78849743fc762b70cac0 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 4 Nov 2024 10:41:50 +0000 Subject: [PATCH 02/24] feat: updating deployment files --- deployments/arbitrumsepolia.json | 996 +++++++++++++++++++++ deployments/arbitrumsepolia_addresses.json | 5 +- 2 files changed, 1000 insertions(+), 1 deletion(-) diff --git a/deployments/arbitrumsepolia.json b/deployments/arbitrumsepolia.json index 64cb75c0..b8a2dd95 100644 --- a/deployments/arbitrumsepolia.json +++ b/deployments/arbitrumsepolia.json @@ -2044,6 +2044,1002 @@ "type": "receive" } ] + }, + "XVSVaultTreasury": { + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "FundsTransferredToXVSStore", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVault", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xvsVault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "XVSVaultTreasury_Implementation": { + "address": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "xvsAddress_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "FundsTransferredToXVSStore", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVault", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xvsVault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, + "XVSVaultTreasury_Proxy": { + "address": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] } } } diff --git a/deployments/arbitrumsepolia_addresses.json b/deployments/arbitrumsepolia_addresses.json index b340e847..037e7a9d 100644 --- a/deployments/arbitrumsepolia_addresses.json +++ b/deployments/arbitrumsepolia_addresses.json @@ -5,6 +5,9 @@ "DefaultProxyAdmin": "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", "ProtocolShareReserve": "0x09267d30798B59c581ce54E861A084C6FC298666", "ProtocolShareReserve_Implementation": "0xF5B07c27d213A2B838A3D155FFEC0d52B17E91fd", - "ProtocolShareReserve_Proxy": "0x09267d30798B59c581ce54E861A084C6FC298666" + "ProtocolShareReserve_Proxy": "0x09267d30798B59c581ce54E861A084C6FC298666", + "XVSVaultTreasury": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", + "XVSVaultTreasury_Implementation": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", + "XVSVaultTreasury_Proxy": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6" } } From 3e3c04ba91946b66c75bb8915294d844997bd98a Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 4 Nov 2024 16:43:05 +0530 Subject: [PATCH 03/24] feat: deployment files for the converters on the arbitrum sepolia --- deploy/004-single-token-converter.ts | 7 + .../SingleTokenConverterBeacon.json | 206 ++ .../SingleTokenConverterImp.json | 2170 +++++++++++++++++ .../arbitrumsepolia/USDCPrimeConverter.json | 229 ++ .../arbitrumsepolia/USDTPrimeConverter.json | 229 ++ .../arbitrumsepolia/WBTCPrimeConverter.json | 229 ++ .../arbitrumsepolia/WETHPrimeConverter.json | 229 ++ .../arbitrumsepolia/XVSVaultConverter.json | 229 ++ 8 files changed, 3528 insertions(+) create mode 100644 deployments/arbitrumsepolia/SingleTokenConverterBeacon.json create mode 100644 deployments/arbitrumsepolia/SingleTokenConverterImp.json create mode 100644 deployments/arbitrumsepolia/USDCPrimeConverter.json create mode 100644 deployments/arbitrumsepolia/USDTPrimeConverter.json create mode 100644 deployments/arbitrumsepolia/WBTCPrimeConverter.json create mode 100644 deployments/arbitrumsepolia/WETHPrimeConverter.json create mode 100644 deployments/arbitrumsepolia/XVSVaultConverter.json diff --git a/deploy/004-single-token-converter.ts b/deploy/004-single-token-converter.ts index aeb68d66..6af25f85 100644 --- a/deploy/004-single-token-converter.ts +++ b/deploy/004-single-token-converter.ts @@ -40,6 +40,13 @@ async function getBaseAssets(network: string): Promise { WETHPrimeConverter: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH on Ethereum XVSVaultConverter: (await ethers.getContractOrNull("XVS"))?.address || ADDRESS_TWO, }, + arbitrumsepolia: { + USDTPrimeConverter: "0xf3118a17863996B9F2A073c9A66Faaa664355cf8", // USDT on arbitrum sepolia + USDCPrimeConverter: "0x86f096B1D970990091319835faF3Ee011708eAe8", // USDC on arbitrum sepolia + WBTCPrimeConverter: "0xFb8d93FD3Cf18386a5564bb5619cD1FdB130dF7D", // WBTC on arbitrum sepolia + WETHPrimeConverter: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", // WETH on arbitrum sepolia + XVSVaultConverter: "0x877Dc896e7b13096D3827872e396927BbE704407", // XVS on arbitrum sepolia + }, // add more networks }; return networkBaseAssets[network]; diff --git a/deployments/arbitrumsepolia/SingleTokenConverterBeacon.json b/deployments/arbitrumsepolia/SingleTokenConverterBeacon.json new file mode 100644 index 00000000..ab02ec39 --- /dev/null +++ b/deployments/arbitrumsepolia/SingleTokenConverterBeacon.json @@ -0,0 +1,206 @@ +{ + "address": "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x86a7addc96db802a66604b9517939506ef182afc3585818ccdfed8e354827685", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "transactionIndex": 1, + "gasUsed": "383392", + "logsBloom": "0x00000000000000000000000200000000000000000000000400800000000000040000000001000000000000000000000000000000000000000000000000000400000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x09cd69cb14b84d695208f88bf2197cdb22da093615a3560409e6ffe172b421a9", + "transactionHash": "0x86a7addc96db802a66604b9517939506ef182afc3585818ccdfed8e354827685", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94296159, + "transactionHash": "0x86a7addc96db802a66604b9517939506ef182afc3585818ccdfed8e354827685", + "address": "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x09cd69cb14b84d695208f88bf2197cdb22da093615a3560409e6ffe172b421a9" + } + ], + "blockNumber": 94296159, + "cumulativeGasUsed": "383392", + "status": 1, + "byzantium": true + }, + "args": ["0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93"], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their implementation contract, which is where they will delegate all function calls. An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\",\"events\":{\"Upgraded(address)\":{\"details\":\"Emitted when the implementation returned by the beacon is changed.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the beacon.\"},\"implementation()\":{\"details\":\"Returns the current implementation address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrades the beacon to a new implementation. Emits an {Upgraded} event. Requirements: - msg.sender must be the owner of the contract. - `newImplementation` must be a contract.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\":\"UpgradeableBeacon\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../../access/Ownable.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\\n * implementation contract, which is where they will delegate all function calls.\\n *\\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\\n */\\ncontract UpgradeableBeacon is IBeacon, Ownable {\\n address private _implementation;\\n\\n /**\\n * @dev Emitted when the implementation returned by the beacon is changed.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\\n * beacon.\\n */\\n constructor(address implementation_) {\\n _setImplementation(implementation_);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function implementation() public view virtual override returns (address) {\\n return _implementation;\\n }\\n\\n /**\\n * @dev Upgrades the beacon to a new implementation.\\n *\\n * Emits an {Upgraded} event.\\n *\\n * Requirements:\\n *\\n * - msg.sender must be the owner of the contract.\\n * - `newImplementation` must be a contract.\\n */\\n function upgradeTo(address newImplementation) public virtual onlyOwner {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Sets the implementation contract address for this beacon\\n *\\n * Requirements:\\n *\\n * - `newImplementation` must be a contract.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"UpgradeableBeacon: implementation is not a contract\\\");\\n _implementation = newImplementation;\\n }\\n}\\n\",\"keccak256\":\"0x6ec71aef5659f3f74011169948d2fcda8c6599be5bb38f986380a8737f96cc0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516105ef3803806105ef83398101604081905261002f9161013a565b61003833610047565b61004181610097565b5061016a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381163b6101185760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561014c57600080fd5b81516001600160a01b038116811461016357600080fd5b9392505050565b610476806101796000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100c45780638da5cb5b146100cc578063f2fde38b146100ea57600080fd5b80633659cfe61461006c5780635c60da1b14610081575b600080fd5b61007f61007a366004610403565b6100fd565b005b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61007f610152565b60005473ffffffffffffffffffffffffffffffffffffffff1661009b565b61007f6100f8366004610403565b610166565b610105610222565b61010e816102a3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61015a610222565b610164600061038e565b565b61016e610222565b73ffffffffffffffffffffffffffffffffffffffff8116610216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61021f8161038e565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020d565b73ffffffffffffffffffffffffffffffffffffffff81163b610347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840161020d565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561041557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461043957600080fd5b939250505056fea26469706673582212207c5035dbfc7adb0300f7d91a2c50e4c557af8518a6a5d1ce5b27b7dcd82f6a9364736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100c45780638da5cb5b146100cc578063f2fde38b146100ea57600080fd5b80633659cfe61461006c5780635c60da1b14610081575b600080fd5b61007f61007a366004610403565b6100fd565b005b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61007f610152565b60005473ffffffffffffffffffffffffffffffffffffffff1661009b565b61007f6100f8366004610403565b610166565b610105610222565b61010e816102a3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61015a610222565b610164600061038e565b565b61016e610222565b73ffffffffffffffffffffffffffffffffffffffff8116610216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61021f8161038e565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020d565b73ffffffffffffffffffffffffffffffffffffffff81163b610347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840161020d565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561041557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461043957600080fd5b939250505056fea26469706673582212207c5035dbfc7adb0300f7d91a2c50e4c557af8518a6a5d1ce5b27b7dcd82f6a9364736f6c63430008190033", + "devdoc": { + "details": "This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their implementation contract, which is where they will delegate all function calls. An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.", + "events": { + "Upgraded(address)": { + "details": "Emitted when the implementation returned by the beacon is changed." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the beacon." + }, + "implementation()": { + "details": "Returns the current implementation address." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrades the beacon to a new implementation. Emits an {Upgraded} event. Requirements: - msg.sender must be the owner of the contract. - `newImplementation` must be a contract." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1876, + "contract": "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol:UpgradeableBeacon", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2493, + "contract": "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol:UpgradeableBeacon", + "label": "_implementation", + "offset": 0, + "slot": "1", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/deployments/arbitrumsepolia/SingleTokenConverterImp.json b/deployments/arbitrumsepolia/SingleTokenConverterImp.json new file mode 100644 index 00000000..ba3d56ec --- /dev/null +++ b/deployments/arbitrumsepolia/SingleTokenConverterImp.json @@ -0,0 +1,2170 @@ +{ + "address": "0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + } + ], + "name": "AmountInHigherThanMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountInMismatched", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + } + ], + "name": "AmountOutLowerThanMinRequired", + "type": "error" + }, + { + "inputs": [], + "name": "AmountOutMismatched", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionConfigNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionEnabledOnlyForPrivateConversions", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensActive", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensPaused", + "type": "error" + }, + { + "inputs": [], + "name": "DeflationaryTokenNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxIncentive", + "type": "uint256" + } + ], + "name": "IncentiveTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMisMatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", + "type": "error" + }, + { + "inputs": [], + "name": "NonZeroIncentiveForPrivateConversion", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetTransferredToDestination", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldBaseAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newBaseAsset", + "type": "address" + } + ], + "name": "BaseAssetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" + } + ], + "name": "ConversionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "converterNetwork", + "type": "address" + } + ], + "name": "ConverterNetworkAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", + "type": "address" + } + ], + "name": "DestinationAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinAmountToConvert", + "type": "uint256" + } + ], + "name": "MinAmountToConvertUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_INCENTIVE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseAsset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "conversionConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "conversionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "converterNetwork", + "outputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "destinationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + }, + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + }, + { + "internalType": "address", + "name": "baseAsset_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceOracle", + "outputs": [ + { + "internalType": "contract ResilientOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baseAsset_", + "type": "address" + } + ], + "name": "setBaseAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" + } + ], + "name": "setConversionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" + } + ], + "name": "setConversionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", + "type": "address" + } + ], + "name": "setConverterNetwork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + } + ], + "name": "setDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "setMinAmountToConvert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0x28c1eed7b2364f9e3d0b685be67161b2503308823d9724c4444966cf5bb221bb", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93", + "transactionIndex": 1, + "gasUsed": "3912939", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000020000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xad933ecddfc58da345f660dbea82c1309edc8c16c506be87ad880518590e40c3", + "transactionHash": "0x28c1eed7b2364f9e3d0b685be67161b2503308823d9724c4444966cf5bb221bb", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94296128, + "transactionHash": "0x28c1eed7b2364f9e3d0b685be67161b2503308823d9724c4444966cf5bb221bb", + "address": "0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0xad933ecddfc58da345f660dbea82c1309edc8c16c506be87ad880518590e40c3" + } + ], + "blockNumber": 94296128, + "cumulativeGasUsed": "3912939", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountInHigherThanMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInMismatched\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountOutLowerThanMinRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountOutMismatched\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionConfigNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionEnabledOnlyForPrivateConversions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeflationaryTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxIncentive\",\"type\":\"uint256\"}],\"name\":\"IncentiveTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputLengthMisMatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientInputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientOutputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientPoolLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConverterNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMinimumAmountToConvert\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConfigAddresses\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonZeroIncentiveForPrivateConversion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetTransferredToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldBaseAsset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBaseAsset\",\"type\":\"address\"}],\"name\":\"BaseAssetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"oldAccess\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"newAccess\",\"type\":\"uint8\"}],\"name\":\"ConversionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldConverterNetwork\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converterNetwork\",\"type\":\"address\"}],\"name\":\"ConverterNetworkAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDestinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"DestinationAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMinAmountToConvert\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinAmountToConvert\",\"type\":\"uint256\"}],\"name\":\"MinAmountToConvertUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"oldPriceOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle\",\"type\":\"address\"}],\"name\":\"PriceOracleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_INCENTIVE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseAsset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"conversionConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterNetwork\",\"outputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAmountToConvert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resumeConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"}],\"name\":\"setBaseAsset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig\",\"name\":\"conversionConfig\",\"type\":\"tuple\"}],\"name\":\"setConversionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokenAddressesOut\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig[]\",\"name\":\"conversionConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConversionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"converterNetwork_\",\"type\":\"address\"}],\"name\":\"setConverterNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"}],\"name\":\"setDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"setMinAmountToConvert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"}],\"name\":\"setPriceOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"balanceOf(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"tokenBalance\":\"Balance of the token the contract has\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\",\"custom:event\":\"Emits ConvertedForExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\",\"custom:event\":\"Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"getAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"getUpdatedAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getUpdatedAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"initialize(address,address,address,address,uint256)\":{\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"baseAsset_\":\"Address of the base asset\",\"destinationAddress_\":\"Address at all incoming tokens will transferred to\",\"minAmountToConvert_\":\"Minimum amount to convert\",\"priceOracle_\":\"Resilient oracle address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pauseConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensPaused thrown when conversion is already paused\",\"custom:event\":\"Emits ConversionPaused on success\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resumeConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensActive thrown when conversion is already active\",\"custom:event\":\"Emits ConversionResumed on success\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setBaseAsset(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"baseAsset_\":\"The new address of the base asset\"}},\"setConversionConfig(address,address,(uint256,uint8))\":{\"custom:access\":\"Controlled by AccessControlManager\",\"custom:error\":\"Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\",\"custom:event\":\"Emits ConversionConfigUpdated event on success\",\"params\":{\"conversionConfig\":\"ConversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressOut\":\"Address of tokenOut\"}},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"custom:error\":\"InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\",\"params\":{\"conversionConfigs\":\"Array of conversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressesOut\":\"Array of addresses of tokenOut\"}},\"setConverterNetwork(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"converterNetwork_\":\"The converterNetwork address to be set\"}},\"setDestination(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"destinationAddress_\":\"The new destination address to be set\"}},\"setMinAmountToConvert(uint256)\":{\"custom:access\":\"Only Governance\",\"params\":{\"minAmountToConvert_\":\"Min amount to convert\"}},\"setPriceOracle(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"priceOracle_\":\"Address of the new price oracle to set\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"The amount to transfer\",\"to\":\"The address to which tokens will be transferred\",\"tokenAddress\":\"The address of the ERC-20 token to sweep\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address)\":{\"details\":\"This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"}}},\"title\":\"SingleTokenConverter\",\"version\":1},\"userdoc\":{\"errors\":{\"AmountInHigherThanMax(uint256,uint256)\":[{\"notice\":\"Thrown when amountIn is higher than amountInMax\"}],\"AmountInMismatched()\":[{\"notice\":\"Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\"}],\"AmountOutLowerThanMinRequired(uint256,uint256)\":[{\"notice\":\"Thrown when amountOut is lower than amountOutMin\"}],\"AmountOutMismatched()\":[{\"notice\":\"Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\"}],\"ConversionConfigNotEnabled()\":[{\"notice\":\"Thrown when conversion is disabled or config does not exist for given pair\"}],\"ConversionEnabledOnlyForPrivateConversions()\":[{\"notice\":\"Thrown when conversion is enabled only for private conversions\"}],\"ConversionTokensActive()\":[{\"notice\":\"Thrown when conversion is Active\"}],\"ConversionTokensPaused()\":[{\"notice\":\"Thrown when conversion is paused\"}],\"DeflationaryTokenNotSupported()\":[{\"notice\":\"Thrown when using convertForExactTokens deflationary tokens\"}],\"IncentiveTooHigh(uint256,uint256)\":[{\"notice\":\"Thrown when incentive is higher than the MAX_INCENTIVE\"}],\"InputLengthMisMatch()\":[{\"notice\":\"Thrown when there is a mismatch in the length of input arrays\"}],\"InsufficientInputAmount()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"InsufficientOutputAmount()\":[{\"notice\":\"Thrown when given output amount is zero\"}],\"InsufficientPoolLiquidity()\":[{\"notice\":\"Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\"}],\"InvalidConverterNetwork()\":[{\"notice\":\"When address of the ConverterNetwork is not set or Zero address\"}],\"InvalidMinimumAmountToConvert()\":[{\"notice\":\"Thrown when minimum amount to convert is zero\"}],\"InvalidToAddress()\":[{\"notice\":\"Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\"}],\"InvalidTokenConfigAddresses()\":[{\"notice\":\"Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\"}],\"NonZeroIncentiveForPrivateConversion()\":[{\"notice\":\"Thrown when trying to set non zero incentive for private conversion\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"AssetTransferredToDestination(address,address,address,uint256)\":{\"notice\":\"Emmitted after the funds transferred to the destination address\"},\"BaseAssetUpdated(address,address)\":{\"notice\":\"Emitted when base asset is updated\"},\"ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)\":{\"notice\":\"Emitted when config is updated for tokens pair\"},\"ConversionPaused(address)\":{\"notice\":\"Emitted when conversion is paused\"},\"ConversionResumed(address)\":{\"notice\":\"Emitted when conversion is unpaused\"},\"ConvertedExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens\"},\"ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\"},\"ConvertedForExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens\"},\"ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\"},\"ConverterNetworkAddressUpdated(address,address)\":{\"notice\":\"Emitted when converterNetwork address is updated\"},\"DestinationAddressUpdated(address,address)\":{\"notice\":\"Emitted when destination address is updated\"},\"MinAmountToConvertUpdated(uint256,uint256)\":{\"notice\":\"Emitted when minimum amount to convert is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PriceOracleUpdated(address,address)\":{\"notice\":\"Emitted when price oracle address is updated\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"}},\"kind\":\"user\",\"methods\":{\"MAX_INCENTIVE()\":{\"notice\":\"Maximum incentive could be\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"balanceOf(address)\":{\"notice\":\"Get the balance for specific token\"},\"baseAsset()\":{\"notice\":\"Address of the base asset token\"},\"conversionConfigurations(address,address)\":{\"notice\":\"conversion configurations for the existing pairs\"},\"conversionPaused()\":{\"notice\":\"Boolean for if conversion is paused\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted\"},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\"},\"converterNetwork()\":{\"notice\":\"Address of the converterNetwork contract\"},\"destinationAddress()\":{\"notice\":\"Address that all incoming tokens are transferred to\"},\"getAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\"},\"getUpdatedAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\"},\"getUpdatedAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\"},\"minAmountToConvert()\":{\"notice\":\"Min amount to convert for private conversions. Defined in USD, with 18 decimals\"},\"pauseConversion()\":{\"notice\":\"Pause conversion of tokens\"},\"priceOracle()\":{\"notice\":\"Venus price oracle contract\"},\"resumeConversion()\":{\"notice\":\"Resume conversion of tokens.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setBaseAsset(address)\":{\"notice\":\"Sets the base asset for the contract\"},\"setConversionConfig(address,address,(uint256,uint8))\":{\"notice\":\"Set the configuration for new or existing conversion pair\"},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"notice\":\"Batch sets the conversion configurations\"},\"setConverterNetwork(address)\":{\"notice\":\"Sets a converter network contract address\"},\"setDestination(address)\":{\"notice\":\"Sets a new destination address\"},\"setMinAmountToConvert(uint256)\":{\"notice\":\"Min amount to convert setter\"},\"setPriceOracle(address)\":{\"notice\":\"Sets a new price oracle\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"To sweep ERC20 tokens and transfer them to user(to address)\"},\"updateAssetsState(address,address)\":{\"notice\":\"This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters\"}},\"notice\":\"SingleTokenConverter used for token conversions and sends received tokens\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/SingleTokenConverter.sol\":\"SingleTokenConverter\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\\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\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\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 cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x005e52885b8f7935dbccb1c87847229a9a2bfb66fd75fe200c9ec6f8a5d7a0e9\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2432799b0d824fc701beb4c30146e912b9aeecf77b5c1635dde6c5fbe6bfc3a7\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x6e71c3df86501df5c0e4bace1333c0c91f9f9cced252a54fb99eeda219b789d5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x14de93ead464da249af31bea0e3bcfb62ec693bea3475fb4d90f055ac81dc5eb\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd9a747f176d9b9de220331b87ed711cc2bd594a118b538a35f3c47060bff7a8b\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/AbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { MANTISSA_ONE, EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title AbstractTokenConverter\\n/// @author Venus\\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\\n/*\\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\\n *\\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\\n * a. convertExactTokensSupportingFeeOnTransferTokens\\n * b. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\\n * similar to Case I.\\n *\\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * a. convertExactTokens\\n * b. convertForExactTokens\\n * c. convertExactTokensSupportingFeeOnTransferTokens\\n * d. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * similar to Case III.\\n *\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n * Example 1:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInAmount - 100\\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\\n * function for tokenIn as deflationary token.\\n *\\n * Example 2:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\\n * tokenOutAmount - 70\\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n *\\n * This contract also supports private conversion between the converters:\\n * Private conversions:\\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\\n *\\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\\n *\\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\\n * tokenAddressOut: As base asset of that converter.\\n *\\n * ConverterNetwork:\\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\\n * and tokenAddressOut provided.\\n *\\n * findTokenConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\\n *\\n * findTokenConvertersForConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\\n */\\n\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Maximum incentive could be\\n uint256 public constant MAX_INCENTIVE = 0.5e18;\\n\\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\\n uint256 public minAmountToConvert;\\n\\n /// @notice Venus price oracle contract\\n ResilientOracle public priceOracle;\\n\\n /// @notice conversion configurations for the existing pairs\\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\\n\\n /// @notice Address that all incoming tokens are transferred to\\n address public destinationAddress;\\n\\n /// @notice Boolean for if conversion is paused\\n bool public conversionPaused;\\n\\n /// @notice Address of the converterNetwork contract\\n IConverterNetwork public converterNetwork;\\n\\n /// @dev This empty reserved space is put in place to allow future versions to add new\\n /// variables without shifting down storage in the inheritance chain.\\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[45] private __gap;\\n\\n /// @notice Emitted when config is updated for tokens pair\\n event ConversionConfigUpdated(\\n address indexed tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 oldIncentive,\\n uint256 newIncentive,\\n ConversionAccessibility oldAccess,\\n ConversionAccessibility newAccess\\n );\\n /// @notice Emitted when price oracle address is updated\\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\\n\\n /// @notice Emitted when destination address is updated\\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\\n\\n /// @notice Emitted when converterNetwork address is updated\\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens\\n event ConvertedExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens\\n event ConvertedForExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when conversion is paused\\n event ConversionPaused(address indexed sender);\\n\\n /// @notice Emitted when conversion is unpaused\\n event ConversionResumed(address indexed sender);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Emitted when minimum amount to convert is updated\\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\\n\\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\\n error AmountOutMismatched();\\n\\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\\n error AmountInMismatched();\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientInputAmount();\\n\\n /// @notice Thrown when given output amount is zero\\n error InsufficientOutputAmount();\\n\\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\\n error ConversionConfigNotEnabled();\\n\\n /// @notice Thrown when conversion is enabled only for private conversions\\n error ConversionEnabledOnlyForPrivateConversions();\\n\\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n error InvalidToAddress();\\n\\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\\n\\n /// @notice Thrown when amountOut is lower than amountOutMin\\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\\n\\n /// @notice Thrown when amountIn is higher than amountInMax\\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\\n\\n /// @notice Thrown when conversion is paused\\n error ConversionTokensPaused();\\n\\n /// @notice Thrown when conversion is Active\\n error ConversionTokensActive();\\n\\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\\n error InvalidTokenConfigAddresses();\\n\\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\\n error InsufficientPoolLiquidity();\\n\\n /// @notice When address of the ConverterNetwork is not set or Zero address\\n error InvalidConverterNetwork();\\n\\n /// @notice Thrown when trying to set non zero incentive for private conversion\\n error NonZeroIncentiveForPrivateConversion();\\n\\n /// @notice Thrown when using convertForExactTokens deflationary tokens\\n error DeflationaryTokenNotSupported();\\n\\n /// @notice Thrown when minimum amount to convert is zero\\n error InvalidMinimumAmountToConvert();\\n\\n /// @notice Thrown when there is a mismatch in the length of input arrays\\n error InputLengthMisMatch();\\n\\n /**\\n * @notice Modifier to ensure valid conversion parameters for a token conversion\\n * and check if conversion is paused or not\\n * @param to The recipient address for the converted tokens\\n * @param tokenAddressIn The input token address for the conversion\\n * @param tokenAddressOut The output token address for the conversion\\n */\\n modifier validConversionParameters(\\n address to,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) {\\n _checkConversionPaused();\\n ensureNonzeroAddress(to);\\n if (to == tokenAddressIn || to == tokenAddressOut) {\\n revert InvalidToAddress();\\n }\\n _;\\n }\\n\\n /// @notice Pause conversion of tokens\\n /// @custom:event Emits ConversionPaused on success\\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\\n /// @custom:access Restricted by ACM\\n function pauseConversion() external {\\n _checkAccessAllowed(\\\"pauseConversion()\\\");\\n _checkConversionPaused();\\n conversionPaused = true;\\n emit ConversionPaused(msg.sender);\\n }\\n\\n /// @notice Resume conversion of tokens.\\n /// @custom:event Emits ConversionResumed on success\\n /// @custom:error ConversionTokensActive thrown when conversion is already active\\n /// @custom:access Restricted by ACM\\n function resumeConversion() external {\\n _checkAccessAllowed(\\\"resumeConversion()\\\");\\n if (!conversionPaused) {\\n revert ConversionTokensActive();\\n }\\n\\n conversionPaused = false;\\n emit ConversionResumed(msg.sender);\\n }\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:access Only Governance\\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\\n _setPriceOracle(priceOracle_);\\n }\\n\\n /// @notice Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:access Only Governance\\n function setDestination(address destinationAddress_) external onlyOwner {\\n _setDestination(destinationAddress_);\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:access Only Governance\\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\\n _setConverterNetwork(converterNetwork_);\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:access Only Governance\\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\\n _checkAccessAllowed(\\\"setMinAmountToConvert(uint256)\\\");\\n _setMinAmountToConvert(minAmountToConvert_);\\n }\\n\\n /// @notice Batch sets the conversion configurations\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressesOut Array of addresses of tokenOut\\n /// @param conversionConfigs Array of conversionConfig config details to update\\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\\n function setConversionConfigs(\\n address tokenAddressIn,\\n address[] calldata tokenAddressesOut,\\n ConversionConfig[] calldata conversionConfigs\\n ) external {\\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\\n\\n for (uint256 i; i < tokenOutArrayLength; ) {\\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert AmountInMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\\n /// otherwise the amount is adjusted\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountOut != amountOutMantissa) {\\n revert AmountOutMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\\n /// @param tokenAddress The address of the ERC-20 token to sweep\\n /// @param to The address to which tokens will be transferred\\n /// @param amount The amount to transfer\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n preSweepToken(tokenAddress, amount);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n amountConvertedMantissa = amountInMantissa;\\n uint256 tokenInToOutConversion;\\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountConvertedMantissa = _divRoundingUp(maxTokenOutReserve * EXP_SCALE, tokenInToOutConversion);\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n\\n amountConvertedMantissa = amountOutMantissa;\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountInMantissa;\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountOutMantissa;\\n }\\n\\n /// @notice This method updated the states of this contract after getting funds from PSR\\n /// after settling the amount(if any) through privateConversion between converters\\n /// @dev This function is called by protocolShareReserve\\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\\n if (balanceDiff > 0) {\\n _privateConversion(comptroller, asset, balanceDiff);\\n }\\n }\\n\\n /// @notice Set the configuration for new or existing conversion pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n /// @custom:event Emits ConversionConfigUpdated event on success\\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\\n /// @custom:access Controlled by AccessControlManager\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) public {\\n _checkAccessAllowed(\\\"setConversionConfig(address,address,ConversionConfig)\\\");\\n ensureNonzeroAddress(tokenAddressIn);\\n ensureNonzeroAddress(tokenAddressOut);\\n\\n if (conversionConfig.incentive > MAX_INCENTIVE) {\\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\\n }\\n\\n if (\\n (tokenAddressIn == tokenAddressOut) ||\\n (tokenAddressIn != _getDestinationBaseAsset()) ||\\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\\n ) {\\n revert InvalidTokenConfigAddresses();\\n }\\n\\n if (\\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\\n conversionConfig.incentive != 0\\n ) {\\n revert NonZeroIncentiveForPrivateConversion();\\n }\\n\\n if (\\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\\n (address(converterNetwork) == address(0))\\n ) {\\n revert InvalidConverterNetwork();\\n }\\n\\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n emit ConversionConfigUpdated(\\n tokenAddressIn,\\n tokenAddressOut,\\n configuration.incentive,\\n conversionConfig.incentive,\\n configuration.conversionAccess,\\n conversionConfig.conversionAccess\\n );\\n\\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n } else {\\n configuration.incentive = conversionConfig.incentive;\\n configuration.conversionAccess = conversionConfig.conversionAccess;\\n }\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param token Address of the token\\n /// @param amount Amount transferred to address(to)\\n function preSweepToken(address token, uint256 amount) internal virtual {}\\n\\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function _convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n if (amountOutMantissa < amountOutMinMantissa) {\\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\\n /// it is called by convertForExactTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert DeflationaryTokenNotSupported();\\n }\\n\\n if (actualAmountIn > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n actualAmountOut = amountOutMantissa;\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n if (amountInMantissa > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\\n }\\n\\n /// @dev return actualAmountOut from reserves for tokenAddressOut\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n function _doTransferOut(\\n address tokenAddressOut,\\n address to,\\n uint256 amountConvertedMantissa\\n ) internal {\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountConvertedMantissa) {\\n revert InsufficientPoolLiquidity();\\n }\\n\\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\\n\\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\\n tokenOut.safeTransfer(to, amountConvertedMantissa);\\n }\\n\\n /// @notice Transfer tokenAddressIn from user to destination\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @return actualAmountIn Actual amount transferred to destination\\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\\n }\\n\\n /// @dev Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:event Emits PriceOracleUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\\n ensureNonzeroAddress(address(priceOracle_));\\n emit PriceOracleUpdated(priceOracle, priceOracle_);\\n priceOracle = priceOracle_;\\n }\\n\\n /// @dev Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:event Emits DestinationAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\\n function _setDestination(address destinationAddress_) internal {\\n ensureNonzeroAddress(destinationAddress_);\\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\\n destinationAddress = destinationAddress_;\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\\n ensureNonzeroAddress(address(converterNetwork_));\\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\\n converterNetwork = converterNetwork_;\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:event MinAmountToConvertUpdated is emitted in success\\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\\n ensureNonzeroValue(minAmountToConvert_);\\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\\n minAmountToConvert = minAmountToConvert_;\\n }\\n\\n /// @dev Hook to perform after converting tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param amountIn Amount of tokenIn converted\\n /// @param amountOut Amount of tokenOut converted\\n function _postConversionHook(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal virtual {}\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init_unchained(\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n _setPriceOracle(priceOracle_);\\n _setDestination(destinationAddress_);\\n _setMinAmountToConvert(minAmountToConvert_);\\n conversionPaused = false;\\n }\\n\\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return Amount of asset, for _privateConversion\\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\\n\\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\\n /// destination contract as destination's base asset\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\\n function _privateConversion(\\n address comptroller,\\n address tokenAddressOut,\\n uint256 amountToConvert\\n ) internal {\\n address tokenAddressIn = _getDestinationBaseAsset();\\n address _destinationAddress = destinationAddress;\\n uint256 convertedTokenInBalance;\\n if (address(converterNetwork) != address(0)) {\\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\\n uint256 convertersLength = converterAddresses.length;\\n for (uint256 i; i < convertersLength; ) {\\n if (converterBalances[i] == 0) break;\\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\\n converterBalances[i],\\n tokenAddressOut,\\n tokenAddressIn\\n );\\n if (amountIn > amountToConvert) {\\n amountIn = amountToConvert;\\n }\\n\\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\\n break;\\n }\\n\\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n\\n IERC20Upgradeable(tokenAddressOut).forceApprove(converterAddresses[i], amountIn);\\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\\n amountIn,\\n 0,\\n tokenAddressOut,\\n tokenAddressIn,\\n _destinationAddress\\n );\\n\\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n amountToConvert -= amountIn;\\n convertedTokenInBalance += (balanceAfter - balanceBefore);\\n\\n if (amountToConvert == 0) break;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n _postPrivateConversionHook(\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance,\\n tokenAddressOut,\\n amountToConvert\\n );\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal virtual {}\\n\\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\\n\\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\\n /// @param amountIn The amount to convert\\n /// @param tokenAddress Address of the token\\n /// @return isValid true if amount to convert is greater than minimum amount to convert\\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\\n priceOracle.updateAssetPrice(tokenAddress);\\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\\n\\n if (amountInInUsd >= minAmountToConvert) {\\n isValid = true;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\\n if (amountInMantissa == 0) {\\n revert InsufficientInputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\\n /// multiplied by conversionWithIncentive which will be >= 1\\n amountOutMantissa = (amountInMantissa * tokenInToOutConversion) / (EXP_SCALE);\\n }\\n\\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\\n if (amountOutMantissa == 0) {\\n revert InsufficientOutputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n\\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\\n converterNetwork.isTokenConverter(msg.sender);\\n if (isPrivateConversion) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\\n if (isPrivateConversion) {\\n amountInMantissa =\\n (amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE) /\\n (tokenInUnderlyingPrice * conversionWithIncentive);\\n } else {\\n amountInMantissa = _divRoundingUp(\\n amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE,\\n tokenInUnderlyingPrice * conversionWithIncentive\\n );\\n }\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n }\\n\\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\\n if (\\n (!(isConverter) &&\\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n }\\n\\n /// @dev To check, is conversion paused\\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\\n function _checkConversionPaused() internal view {\\n if (conversionPaused) {\\n revert ConversionTokensPaused();\\n }\\n }\\n\\n /// @dev Get base asset address of the destination contract\\n /// @return Address of the base asset\\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\\n\\n /// @dev Performs division where the result is rounded up\\n /// @param numerator The numerator of the division operation\\n /// @param denominator The denominator of the division operation. Must be non-zero\\n /// @return The result of the division, rounded up\\n function _divRoundingUp(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\\n return (numerator + denominator - 1) / denominator;\\n }\\n}\\n\",\"keccak256\":\"0xf87680dcb5a46a16663923c575661eda78ef57d29b7d78a85ddac00062426e18\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0x7852d4f8a6dd1c80d14342f8ff2e26f723eb00c888e9a9e50a5fe8f95c59200c\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/SingleTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { AbstractTokenConverter } from \\\"./AbstractTokenConverter.sol\\\";\\n\\n/// @title SingleTokenConverter\\n/// @author Venus\\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract SingleTokenConverter is AbstractTokenConverter {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Address of the base asset token\\n address public baseAsset;\\n\\n /// @notice Emitted when base asset is updated\\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\\n\\n /// @notice Emmitted after the funds transferred to the destination address\\n event AssetTransferredToDestination(\\n address indexed receiver,\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param baseAsset_ Address of the base asset\\n /// @param minAmountToConvert_ Minimum amount to convert\\n function initialize(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n address baseAsset_,\\n uint256 minAmountToConvert_\\n ) public initializer {\\n _setBaseAsset(baseAsset_);\\n\\n // Initialize AbstractTokenConverter\\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @notice Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:access Only Governance\\n function setBaseAsset(address baseAsset_) external onlyOwner {\\n _setBaseAsset(baseAsset_);\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param tokenAddress Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n tokenBalance = token.balanceOf(address(this));\\n }\\n\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address.\\n /// @return balanceLeft Amount of asset, for _privateConversion\\n // solhint-disable-next-line\\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\\n IERC20Upgradeable token = IERC20Upgradeable(asset);\\n uint256 balance = token.balanceOf(address(this));\\n balanceLeft = balance;\\n\\n if (asset == baseAsset) {\\n balanceLeft = 0;\\n token.safeTransfer(destinationAddress, balance);\\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\\n }\\n }\\n\\n /// @dev Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n /// @custom:event BaseAssetUpdated is emitted on success\\n function _setBaseAsset(address baseAsset_) internal {\\n ensureNonzeroAddress(baseAsset_);\\n emit BaseAssetUpdated(baseAsset, baseAsset_);\\n baseAsset = baseAsset_;\\n }\\n\\n /// @dev Get base asset address\\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\\n destinationBaseAsset = baseAsset;\\n }\\n}\\n\",\"keccak256\":\"0xabeb5e99b4aa03662ffa8fac4e9314a018eb8a674ac73085066d8f38e16be45f\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x6080604052348015600f57600080fd5b506016601a565b60d7565b600054610100900460ff161560855760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161460d5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6141a6806100e66000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613958565b610562565b005b6102ee6102e9366004613975565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613958565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613958565b610635565b6102ee61034a3660046139b7565b610646565b6102d961035d366004613958565b610784565b6102d9610370366004613958565b610795565b6102d96107a6565b6102ee61038b366004613975565b61088c565b6102d961039e366004613a16565b61095a565b6102ee6103b1366004613975565b6109f7565b6102ee6103c4366004613975565b610b00565b6103dc6103d7366004613958565b610bff565b604051908152602001610288565b6102d9610c8c565b6102d9610400366004613a57565b610ca0565b6102d9610ce7565b6033546001600160a01b0316610274565b6102ee61042c3660046139b7565b610d77565b6102d961043f366004613a70565b610e61565b610479610452366004613a70565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b604051610288929190613b13565b6097546001600160a01b0316610274565b6102ee6104a63660046139b7565b610e97565b6102d9610f81565b6102d96104c1366004613b73565b611033565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b3660046139b7565b6110d1565b6102d961052e366004613c27565b6111f4565b6102d9610541366004613958565b611593565b6102d9610554366004613c98565b61161c565b6103dc60fb5481565b61056a6117a6565b61057381611800565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613aa9565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610bff565b905085811015610608578095505b85925061061686868661187d565b508092505050935093915050565b61062c6117a6565b61057381611be3565b61063d6117a6565b61057381611cd8565b600080828585610654611d57565b61065d83611dac565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611dec565b6106da8a8a8a8a8a611e45565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117a6565b61057381611ecc565b61079d6117a6565b61057381611f49565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611fc6565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613aa9565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610915868686612092565b9092509050600061092585610bff565b9050828110156109505761094a610944670de0b6b3a764000083613d2b565b8361239f565b93508092505b5050935093915050565b6109626117a6565b61096a611dec565b61097383611dac565b61097c82611dac565b610985816123cb565b8261099a6001600160a01b0382168484612405565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109df91815260200190565b60405180910390a3506109f2600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610ad357600080fd5b505af1158015610ae7573d6000803e3d6000fd5b50505050610af6858585612092565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b6457600080fd5b505af1158015610b78573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bdc57600080fd5b505af1158015610bf0573d6000803e3d6000fd5b50505050610af685858561187d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c859190613d42565b9392505050565b610c946117a6565b610c9e60006124cc565b565b610cde6040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611fc6565b610573816124fd565b60655433906001600160a01b03168114610d6e5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610573816124cc565b600080828585610d85611d57565b610d8e83611dac565b816001600160a01b0316836001600160a01b03161480610dbf5750806001600160a01b0316836001600160a01b0316145b15610df6576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dfe611dec565b610e0b8a8a8a8a8a611e45565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e69611dec565b6000610e758383612547565b90508015610e8857610e8883838361265c565b50610e93600160c955565b5050565b600080828585610ea5611d57565b610eae83611dac565b816001600160a01b0316836001600160a01b03161480610edf5750806001600160a01b0316836001600160a01b0316145b15610f16576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f1e611dec565b610f2b8a8a8a8a8a612ab1565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fbf6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611fc6565b610fc7611d57565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b8281811461106d576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110c8576110c08787878481811061108e5761108e613d5b565b90506020020160208101906110a39190613958565b8686858181106110b5576110b5613d5b565b9050604002016111f4565b600101611070565b50505050505050565b6000808285856110df611d57565b6110e883611dac565b816001600160a01b0316836001600160a01b031614806111195750806001600160a01b0316836001600160a01b0316145b15611150576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611158611dec565b6111658a8a8a8a8a612b43565b90955093508884146111a3576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61121560405180606001604052806035815260200161413c60359139611fc6565b61121e83611dac565b61122782611dac565b6706f05b59d3b200008135111561127b576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d65565b816001600160a01b0316836001600160a01b031614806112aa575061012d546001600160a01b03848116911614155b806112f2575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff1660038111156112ef576112ef613aa9565b14155b15611329576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261133b6040830160208401613d8a565b600381111561134c5761134c613aa9565b1480156113595750803515155b15611390576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113a26040830160208401613d8a565b60038111156113b3576113b3613aa9565b14806113df575060016113cc6040830160208401613d8a565b60038111156113dd576113dd613aa9565b145b80156113f4575060ff546001600160a01b0316155b1561142b576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff9091169161149b91908a01908a01613d8a565b6040516114ab9493929190613dab565b60405180910390a360006114c56040840160208501613d8a565b60038111156114d6576114d6613aa9565b03611533576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905561158d565b813581556115476040830160208401613d8a565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600381111561158757611587613aa9565b02179055505b50505050565b61159b6117a6565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115e46033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff161580801561163c5750600054600160ff909116105b806116565750303b158015611656575060005460ff166001145b6116c85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d65565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561172657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61172f83611cd8565b61173b86868685612c00565b801561179e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610c9e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d65565b61180981611dac565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118ba576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561190e5761190e613aa9565b600381111561191f5761191f613aa9565b905250905060008160200151600381111561193c5761193c613aa9565b03611973576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb9190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a889190613d42565b835160ff54919250906000906001600160a01b031615801590611b2b575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2b9190613dd3565b90508015611b3857600091505b6000611b4c83670de0b6b3a7640000613df5565b90508115611b8c57611b5e8186613d2b565b670de0b6b3a7640000611b71868e613d2b565b611b7b9190613d2b565b611b859190613e08565b9750611bbe565b611bbb670de0b6b3a7640000611ba2868e613d2b565b611bac9190613d2b565b611bb68388613d2b565b61239f565b97505b83611bc98287613d2b565b611bd39190613e08565b9650505050505050935093915050565b6001600160a01b038116611c5f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d65565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611ce181611dac565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610c9e576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e3e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d65565b600260c955565b600080611e528585612c99565b611e5c8588612db9565b9150611e698286866109f7565b91505085811015611eb0576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d65565b611ebb848483612f04565b9550959350505050565b600160c955565b611ed581611dac565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f5281611dac565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906120129033908690600401613eb1565b602060405180830381865afa15801561202f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120539190613dd3565b905080610e93573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d6593929190613ed3565b600080846000036120cf576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561212357612123613aa9565b600381111561213457612134613aa9565b905250905060008160200151600381111561215157612151613aa9565b03612188576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122109190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229d9190613d42565b835160ff54919250906001600160a01b03161580159061233d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233d9190613dd3565b15612346575060005b600061235a82670de0b6b3a7640000613df5565b9050826123678286613d2b565b6123719190613e08565b9550670de0b6b3a7640000612386878c613d2b565b6123909190613e08565b96505050505050935093915050565b60008160016123ae8286613df5565b6123b89190613eff565b6123c29190613e08565b90505b92915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b0383166024820152604481018290526109f29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612f67565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105738161304f565b612506816123cb565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190613d42565b61012d549093508391506001600160a01b03908116908516036126545760fe546000935061260a906001600160a01b03848116911683612405565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061267161012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612aac5760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af1158015612700573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127469190810190614023565b8151919350915060005b81811015612aa75782818151811061276a5761276a613d5b565b602002602001015160000315612aa757600084828151811061278e5761278e613d5b565b60200260200101516001600160a01b0316636f1a30a88584815181106127b6576127b6613d5b565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127f8939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015612816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283a91906140e8565b915050888111156128485750875b612852818b6130b9565b61285c5750612aa7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa1580156128bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e39190613d42565b905061291c8684815181106128fa576128fa613d5b565b6020026020010151838d6001600160a01b03166131f19092919063ffffffff16565b85838151811061292e5761292e613d5b565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af11580156129b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc91906140e8565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a659190613d42565b9050612a71838c613eff565b9a50612a7d8282613eff565b612a879089613df5565b97508a600003612a9957505050612aa7565b836001019350505050612750565b505050505b61179e565b600080612abe8585612c99565b6000612acb878787610b00565b91505087811115612b12576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612b1c8682612db9565b9250612b298387876109f7565b9250612b389050858584612f04565b509550959350505050565b600080612b508585612c99565b6000612b5d878787610b00565b915050612b6a8682612db9565b9250808314612ba5576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612be9576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612bf4858589612f04565b50909694955050505050565b600054610100900460ff16612c7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b612c86846132c7565b612c8e613355565b61158d8383836133da565b60ff546000906001600160a01b031615801590612d36575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d369190613dd3565b905080158015612d82575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612d8057612d80613aa9565b145b156109f2576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e469190613d42565b60fe54909150612e65906001600160a01b03848116913391168761349f565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612eca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eee9190613d42565b9050612efa8282613eff565b9695505050505050565b6000612f0f84610bff565b905081811015612f4b576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612f606001600160a01b0382168585612405565b5050505050565b6000612fbc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134f09092919063ffffffff16565b9050805160001480612fdd575080806020019051810190612fdd9190613dd3565b6109f25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d65565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561311a57600080fd5b505af115801561312e573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c69190613d42565b6131d09190613d2b565b6131da9190613e08565b905060fb5481106131ea57600191505b5092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526132708482613507565b61158d576040516001600160a01b0384166024820152600060448201526132bd9085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161244a565b61158d8482612f67565b600054610100900460ff166133445760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61334c6135ae565b61057381613633565b600054610100900460ff166133d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e6136b0565b600054610100900460ff166134575760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61346083611f49565b61346982611800565b613472816124fd565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b038085166024830152831660448201526064810182905261158d9085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161244a565b60606134ff848460008561372d565b949350505050565b6000806000846001600160a01b031684604051613524919061410c565b6000604051808303816000865af19150503d8060008114613561576040519150601f19603f3d011682016040523d82523d6000602084013e613566565b606091505b50915091508180156135905750805115806135905750808060200190518101906135909190613dd3565b80156135a557506001600160a01b0385163b15155b95945050505050565b600054610100900460ff1661362b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e61381f565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b600054610100900460ff16611ec55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b6060824710156137a55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d65565b600080866001600160a01b031685876040516137c1919061410c565b60006040518083038185875af1925050503d80600081146137fe576040519150601f19603f3d011682016040523d82523d6000602084013e613803565b606091505b5091509150613814878383876138a5565b979650505050505050565b600054610100900460ff1661389c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e336124cc565b6060831561391457825160000361390d576001600160a01b0385163b61390d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d65565b50816134ff565b6134ff83838151156139295781518083602001fd5b8060405162461bcd60e51b8152600401610d659190614128565b6001600160a01b038116811461057357600080fd5b60006020828403121561396a57600080fd5b8135610c8581613943565b60008060006060848603121561398a57600080fd5b83359250602084013561399c81613943565b915060408401356139ac81613943565b809150509250925092565b600080600080600060a086880312156139cf57600080fd5b853594506020860135935060408601356139e881613943565b925060608601356139f881613943565b91506080860135613a0881613943565b809150509295509295909350565b600080600060608486031215613a2b57600080fd5b8335613a3681613943565b92506020840135613a4681613943565b929592945050506040919091013590565b600060208284031215613a6957600080fd5b5035919050565b60008060408385031215613a8357600080fd5b8235613a8e81613943565b91506020830135613a9e81613943565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613b0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c856020830184613ad8565b60008083601f840112613b3957600080fd5b50813567ffffffffffffffff811115613b5157600080fd5b6020830191508360208260061b8501011115613b6c57600080fd5b9250929050565b600080600080600060608688031215613b8b57600080fd5b8535613b9681613943565b9450602086013567ffffffffffffffff80821115613bb357600080fd5b818801915088601f830112613bc757600080fd5b813581811115613bd657600080fd5b8960208260051b8501011115613beb57600080fd5b602083019650809550506040880135915080821115613c0957600080fd5b50613c1688828901613b27565b969995985093965092949392505050565b60008060008385036080811215613c3d57600080fd5b8435613c4881613943565b93506020850135613c5881613943565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613c8a57600080fd5b506040840190509250925092565b600080600080600060a08688031215613cb057600080fd5b8535613cbb81613943565b94506020860135613ccb81613943565b93506040860135613cdb81613943565b92506060860135613ceb81613943565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176123c5576123c5613cfc565b600060208284031215613d5457600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613d9c57600080fd5b813560048110610c8557600080fd5b8481526020810184905260808101613dc66040830185613ad8565b6135a56060830184613ad8565b600060208284031215613de557600080fd5b81518015158114610c8557600080fd5b808201808211156123c5576123c5613cfc565b600082613e3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015613e5e578181015183820152602001613e46565b50506000910152565b60008151808452613e7f816020860160208601613e43565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134ff6040830184613e67565b60006001600160a01b038086168352808516602084015250606060408301526135a56060830184613e67565b818103818111156123c5576123c5613cfc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f8857613f88613f12565b604052919050565b600067ffffffffffffffff821115613faa57613faa613f12565b5060051b60200190565b600082601f830112613fc557600080fd5b81516020613fda613fd583613f90565b613f41565b8083825260208201915060208460051b870101935086841115613ffc57600080fd5b602086015b848110156140185780518352918301918301614001565b509695505050505050565b6000806040838503121561403657600080fd5b825167ffffffffffffffff8082111561404e57600080fd5b818501915085601f83011261406257600080fd5b81516020614072613fd583613f90565b82815260059290921b8401810191818101908984111561409157600080fd5b948201945b838610156140b85785516140a981613943565b82529482019490820190614096565b918801519196509093505050808211156140d157600080fd5b506140de85828601613fb4565b9150509250929050565b600080604083850312156140fb57600080fd5b505080516020909101519092909150565b6000825161411e818460208701613e43565b9190910192915050565b6020815260006123c26020830184613e6756fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a26469706673582212207e09b2851b53f45e06f0d26515bd281b9d3817c41e4298fc7d827cf832aaa9d064736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613958565b610562565b005b6102ee6102e9366004613975565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613958565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613958565b610635565b6102ee61034a3660046139b7565b610646565b6102d961035d366004613958565b610784565b6102d9610370366004613958565b610795565b6102d96107a6565b6102ee61038b366004613975565b61088c565b6102d961039e366004613a16565b61095a565b6102ee6103b1366004613975565b6109f7565b6102ee6103c4366004613975565b610b00565b6103dc6103d7366004613958565b610bff565b604051908152602001610288565b6102d9610c8c565b6102d9610400366004613a57565b610ca0565b6102d9610ce7565b6033546001600160a01b0316610274565b6102ee61042c3660046139b7565b610d77565b6102d961043f366004613a70565b610e61565b610479610452366004613a70565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b604051610288929190613b13565b6097546001600160a01b0316610274565b6102ee6104a63660046139b7565b610e97565b6102d9610f81565b6102d96104c1366004613b73565b611033565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b3660046139b7565b6110d1565b6102d961052e366004613c27565b6111f4565b6102d9610541366004613958565b611593565b6102d9610554366004613c98565b61161c565b6103dc60fb5481565b61056a6117a6565b61057381611800565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613aa9565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610bff565b905085811015610608578095505b85925061061686868661187d565b508092505050935093915050565b61062c6117a6565b61057381611be3565b61063d6117a6565b61057381611cd8565b600080828585610654611d57565b61065d83611dac565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611dec565b6106da8a8a8a8a8a611e45565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117a6565b61057381611ecc565b61079d6117a6565b61057381611f49565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611fc6565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613aa9565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610915868686612092565b9092509050600061092585610bff565b9050828110156109505761094a610944670de0b6b3a764000083613d2b565b8361239f565b93508092505b5050935093915050565b6109626117a6565b61096a611dec565b61097383611dac565b61097c82611dac565b610985816123cb565b8261099a6001600160a01b0382168484612405565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109df91815260200190565b60405180910390a3506109f2600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610ad357600080fd5b505af1158015610ae7573d6000803e3d6000fd5b50505050610af6858585612092565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b6457600080fd5b505af1158015610b78573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bdc57600080fd5b505af1158015610bf0573d6000803e3d6000fd5b50505050610af685858561187d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c859190613d42565b9392505050565b610c946117a6565b610c9e60006124cc565b565b610cde6040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611fc6565b610573816124fd565b60655433906001600160a01b03168114610d6e5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610573816124cc565b600080828585610d85611d57565b610d8e83611dac565b816001600160a01b0316836001600160a01b03161480610dbf5750806001600160a01b0316836001600160a01b0316145b15610df6576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dfe611dec565b610e0b8a8a8a8a8a611e45565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e69611dec565b6000610e758383612547565b90508015610e8857610e8883838361265c565b50610e93600160c955565b5050565b600080828585610ea5611d57565b610eae83611dac565b816001600160a01b0316836001600160a01b03161480610edf5750806001600160a01b0316836001600160a01b0316145b15610f16576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f1e611dec565b610f2b8a8a8a8a8a612ab1565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fbf6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611fc6565b610fc7611d57565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b8281811461106d576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110c8576110c08787878481811061108e5761108e613d5b565b90506020020160208101906110a39190613958565b8686858181106110b5576110b5613d5b565b9050604002016111f4565b600101611070565b50505050505050565b6000808285856110df611d57565b6110e883611dac565b816001600160a01b0316836001600160a01b031614806111195750806001600160a01b0316836001600160a01b0316145b15611150576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611158611dec565b6111658a8a8a8a8a612b43565b90955093508884146111a3576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61121560405180606001604052806035815260200161413c60359139611fc6565b61121e83611dac565b61122782611dac565b6706f05b59d3b200008135111561127b576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d65565b816001600160a01b0316836001600160a01b031614806112aa575061012d546001600160a01b03848116911614155b806112f2575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff1660038111156112ef576112ef613aa9565b14155b15611329576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261133b6040830160208401613d8a565b600381111561134c5761134c613aa9565b1480156113595750803515155b15611390576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113a26040830160208401613d8a565b60038111156113b3576113b3613aa9565b14806113df575060016113cc6040830160208401613d8a565b60038111156113dd576113dd613aa9565b145b80156113f4575060ff546001600160a01b0316155b1561142b576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff9091169161149b91908a01908a01613d8a565b6040516114ab9493929190613dab565b60405180910390a360006114c56040840160208501613d8a565b60038111156114d6576114d6613aa9565b03611533576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905561158d565b813581556115476040830160208401613d8a565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600381111561158757611587613aa9565b02179055505b50505050565b61159b6117a6565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115e46033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff161580801561163c5750600054600160ff909116105b806116565750303b158015611656575060005460ff166001145b6116c85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d65565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561172657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61172f83611cd8565b61173b86868685612c00565b801561179e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610c9e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d65565b61180981611dac565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118ba576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561190e5761190e613aa9565b600381111561191f5761191f613aa9565b905250905060008160200151600381111561193c5761193c613aa9565b03611973576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb9190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a889190613d42565b835160ff54919250906000906001600160a01b031615801590611b2b575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2b9190613dd3565b90508015611b3857600091505b6000611b4c83670de0b6b3a7640000613df5565b90508115611b8c57611b5e8186613d2b565b670de0b6b3a7640000611b71868e613d2b565b611b7b9190613d2b565b611b859190613e08565b9750611bbe565b611bbb670de0b6b3a7640000611ba2868e613d2b565b611bac9190613d2b565b611bb68388613d2b565b61239f565b97505b83611bc98287613d2b565b611bd39190613e08565b9650505050505050935093915050565b6001600160a01b038116611c5f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d65565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611ce181611dac565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610c9e576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e3e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d65565b600260c955565b600080611e528585612c99565b611e5c8588612db9565b9150611e698286866109f7565b91505085811015611eb0576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d65565b611ebb848483612f04565b9550959350505050565b600160c955565b611ed581611dac565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f5281611dac565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906120129033908690600401613eb1565b602060405180830381865afa15801561202f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120539190613dd3565b905080610e93573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d6593929190613ed3565b600080846000036120cf576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561212357612123613aa9565b600381111561213457612134613aa9565b905250905060008160200151600381111561215157612151613aa9565b03612188576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122109190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229d9190613d42565b835160ff54919250906001600160a01b03161580159061233d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233d9190613dd3565b15612346575060005b600061235a82670de0b6b3a7640000613df5565b9050826123678286613d2b565b6123719190613e08565b9550670de0b6b3a7640000612386878c613d2b565b6123909190613e08565b96505050505050935093915050565b60008160016123ae8286613df5565b6123b89190613eff565b6123c29190613e08565b90505b92915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b0383166024820152604481018290526109f29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612f67565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105738161304f565b612506816123cb565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190613d42565b61012d549093508391506001600160a01b03908116908516036126545760fe546000935061260a906001600160a01b03848116911683612405565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061267161012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612aac5760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af1158015612700573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127469190810190614023565b8151919350915060005b81811015612aa75782818151811061276a5761276a613d5b565b602002602001015160000315612aa757600084828151811061278e5761278e613d5b565b60200260200101516001600160a01b0316636f1a30a88584815181106127b6576127b6613d5b565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127f8939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015612816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283a91906140e8565b915050888111156128485750875b612852818b6130b9565b61285c5750612aa7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa1580156128bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e39190613d42565b905061291c8684815181106128fa576128fa613d5b565b6020026020010151838d6001600160a01b03166131f19092919063ffffffff16565b85838151811061292e5761292e613d5b565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af11580156129b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc91906140e8565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a659190613d42565b9050612a71838c613eff565b9a50612a7d8282613eff565b612a879089613df5565b97508a600003612a9957505050612aa7565b836001019350505050612750565b505050505b61179e565b600080612abe8585612c99565b6000612acb878787610b00565b91505087811115612b12576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612b1c8682612db9565b9250612b298387876109f7565b9250612b389050858584612f04565b509550959350505050565b600080612b508585612c99565b6000612b5d878787610b00565b915050612b6a8682612db9565b9250808314612ba5576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612be9576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612bf4858589612f04565b50909694955050505050565b600054610100900460ff16612c7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b612c86846132c7565b612c8e613355565b61158d8383836133da565b60ff546000906001600160a01b031615801590612d36575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d369190613dd3565b905080158015612d82575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612d8057612d80613aa9565b145b156109f2576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e469190613d42565b60fe54909150612e65906001600160a01b03848116913391168761349f565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612eca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eee9190613d42565b9050612efa8282613eff565b9695505050505050565b6000612f0f84610bff565b905081811015612f4b576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612f606001600160a01b0382168585612405565b5050505050565b6000612fbc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134f09092919063ffffffff16565b9050805160001480612fdd575080806020019051810190612fdd9190613dd3565b6109f25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d65565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561311a57600080fd5b505af115801561312e573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c69190613d42565b6131d09190613d2b565b6131da9190613e08565b905060fb5481106131ea57600191505b5092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526132708482613507565b61158d576040516001600160a01b0384166024820152600060448201526132bd9085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161244a565b61158d8482612f67565b600054610100900460ff166133445760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61334c6135ae565b61057381613633565b600054610100900460ff166133d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e6136b0565b600054610100900460ff166134575760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61346083611f49565b61346982611800565b613472816124fd565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b038085166024830152831660448201526064810182905261158d9085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161244a565b60606134ff848460008561372d565b949350505050565b6000806000846001600160a01b031684604051613524919061410c565b6000604051808303816000865af19150503d8060008114613561576040519150601f19603f3d011682016040523d82523d6000602084013e613566565b606091505b50915091508180156135905750805115806135905750808060200190518101906135909190613dd3565b80156135a557506001600160a01b0385163b15155b95945050505050565b600054610100900460ff1661362b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e61381f565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b600054610100900460ff16611ec55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b6060824710156137a55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d65565b600080866001600160a01b031685876040516137c1919061410c565b60006040518083038185875af1925050503d80600081146137fe576040519150601f19603f3d011682016040523d82523d6000602084013e613803565b606091505b5091509150613814878383876138a5565b979650505050505050565b600054610100900460ff1661389c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e336124cc565b6060831561391457825160000361390d576001600160a01b0385163b61390d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d65565b50816134ff565b6134ff83838151156139295781518083602001fd5b8060405162461bcd60e51b8152600401610d659190614128565b6001600160a01b038116811461057357600080fd5b60006020828403121561396a57600080fd5b8135610c8581613943565b60008060006060848603121561398a57600080fd5b83359250602084013561399c81613943565b915060408401356139ac81613943565b809150509250925092565b600080600080600060a086880312156139cf57600080fd5b853594506020860135935060408601356139e881613943565b925060608601356139f881613943565b91506080860135613a0881613943565b809150509295509295909350565b600080600060608486031215613a2b57600080fd5b8335613a3681613943565b92506020840135613a4681613943565b929592945050506040919091013590565b600060208284031215613a6957600080fd5b5035919050565b60008060408385031215613a8357600080fd5b8235613a8e81613943565b91506020830135613a9e81613943565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613b0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c856020830184613ad8565b60008083601f840112613b3957600080fd5b50813567ffffffffffffffff811115613b5157600080fd5b6020830191508360208260061b8501011115613b6c57600080fd5b9250929050565b600080600080600060608688031215613b8b57600080fd5b8535613b9681613943565b9450602086013567ffffffffffffffff80821115613bb357600080fd5b818801915088601f830112613bc757600080fd5b813581811115613bd657600080fd5b8960208260051b8501011115613beb57600080fd5b602083019650809550506040880135915080821115613c0957600080fd5b50613c1688828901613b27565b969995985093965092949392505050565b60008060008385036080811215613c3d57600080fd5b8435613c4881613943565b93506020850135613c5881613943565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613c8a57600080fd5b506040840190509250925092565b600080600080600060a08688031215613cb057600080fd5b8535613cbb81613943565b94506020860135613ccb81613943565b93506040860135613cdb81613943565b92506060860135613ceb81613943565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176123c5576123c5613cfc565b600060208284031215613d5457600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613d9c57600080fd5b813560048110610c8557600080fd5b8481526020810184905260808101613dc66040830185613ad8565b6135a56060830184613ad8565b600060208284031215613de557600080fd5b81518015158114610c8557600080fd5b808201808211156123c5576123c5613cfc565b600082613e3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015613e5e578181015183820152602001613e46565b50506000910152565b60008151808452613e7f816020860160208601613e43565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134ff6040830184613e67565b60006001600160a01b038086168352808516602084015250606060408301526135a56060830184613e67565b818103818111156123c5576123c5613cfc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f8857613f88613f12565b604052919050565b600067ffffffffffffffff821115613faa57613faa613f12565b5060051b60200190565b600082601f830112613fc557600080fd5b81516020613fda613fd583613f90565b613f41565b8083825260208201915060208460051b870101935086841115613ffc57600080fd5b602086015b848110156140185780518352918301918301614001565b509695505050505050565b6000806040838503121561403657600080fd5b825167ffffffffffffffff8082111561404e57600080fd5b818501915085601f83011261406257600080fd5b81516020614072613fd583613f90565b82815260059290921b8401810191818101908984111561409157600080fd5b948201945b838610156140b85785516140a981613943565b82529482019490820190614096565b918801519196509093505050808211156140d157600080fd5b506140de85828601613fb4565b9150509250929050565b600080604083850312156140fb57600080fd5b505080516020909101519092909150565b6000825161411e818460208701613e43565b9190910192915050565b6020815260006123c26020830184613e6756fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a26469706673582212207e09b2851b53f45e06f0d26515bd281b9d3817c41e4298fc7d827cf832aaa9d064736f6c63430008190033", + "devdoc": { + "author": "Venus", + "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "balanceOf(address)": { + "params": { + "tokenAddress": "Address of the token" + }, + "returns": { + "tokenBalance": "Balance of the token the contract has" + } + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor" + }, + "convertExactTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa", + "custom:event": "Emits ConvertedExactTokens event on success", + "details": "Method does not support deflationary tokens transfer", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "amountOutMinMantissa": "Min amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa", + "custom:event": "Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "amountOutMinMantissa": "Min amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "convertForExactTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa", + "custom:event": "Emits ConvertedForExactTokens event on success", + "details": "Method does not support deflationary tokens transfer", + "params": { + "amountInMaxMantissa": "Max amount of tokenAddressIn", + "amountOutMantissa": "Amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa", + "custom:event": "Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success", + "params": { + "amountInMaxMantissa": "Max amount of tokenAddressIn", + "amountOutMantissa": "Amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "getAmountIn(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion", + "details": "This function retrieves values without altering token prices", + "params": { + "amountOutMantissa": "Amount of tokenAddressOut user wants to receive", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressOut should be transferred after conversion", + "amountInMantissa": "Amount of the tokenAddressIn sender would send to contract before conversion" + } + }, + "getAmountOut(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion", + "details": "This function retrieves values without altering token prices", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressIn should be transferred after conversion", + "amountOutMantissa": "Amount of the tokenAddressOut sender should receive after conversion" + } + }, + "getUpdatedAmountIn(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair", + "params": { + "amountOutMantissa": "Amount of tokenAddressOut user wants to receive", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressOut should be transferred after conversion", + "amountInMantissa": "Amount of the tokenAddressIn sender would send to contract before conversion" + } + }, + "getUpdatedAmountOut(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressIn should be transferred after conversion", + "amountOutMantissa": "Amount of the tokenAddressOut sender should receive after conversion" + } + }, + "initialize(address,address,address,address,uint256)": { + "params": { + "accessControlManager_": "Access control manager contract address", + "baseAsset_": "Address of the base asset", + "destinationAddress_": "Address at all incoming tokens will transferred to", + "minAmountToConvert_": "Minimum amount to convert", + "priceOracle_": "Resilient oracle address" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pauseConversion()": { + "custom:access": "Restricted by ACM", + "custom:error": "ConversionTokensPaused thrown when conversion is already paused", + "custom:event": "Emits ConversionPaused on success" + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "resumeConversion()": { + "custom:access": "Restricted by ACM", + "custom:error": "ConversionTokensActive thrown when conversion is already active", + "custom:event": "Emits ConversionResumed on success" + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setBaseAsset(address)": { + "custom:access": "Only Governance", + "params": { + "baseAsset_": "The new address of the base asset" + } + }, + "setConversionConfig(address,address,(uint256,uint8))": { + "custom:access": "Controlled by AccessControlManager", + "custom:error": "Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion", + "custom:event": "Emits ConversionConfigUpdated event on success", + "params": { + "conversionConfig": "ConversionConfig config details to update", + "tokenAddressIn": "Address of tokenIn", + "tokenAddressOut": "Address of tokenOut" + } + }, + "setConversionConfigs(address,address[],(uint256,uint8)[])": { + "custom:error": "InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches", + "params": { + "conversionConfigs": "Array of conversionConfig config details to update", + "tokenAddressIn": "Address of tokenIn", + "tokenAddressesOut": "Array of addresses of tokenOut" + } + }, + "setConverterNetwork(address)": { + "custom:access": "Only Governance", + "params": { + "converterNetwork_": "The converterNetwork address to be set" + } + }, + "setDestination(address)": { + "custom:access": "Only Governance", + "params": { + "destinationAddress_": "The new destination address to be set" + } + }, + "setMinAmountToConvert(uint256)": { + "custom:access": "Only Governance", + "params": { + "minAmountToConvert_": "Min amount to convert" + } + }, + "setPriceOracle(address)": { + "custom:access": "Only Governance", + "params": { + "priceOracle_": "Address of the new price oracle to set" + } + }, + "sweepToken(address,address,uint256)": { + "custom:access": "Only Governance", + "custom:error": "ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero", + "custom:event": "Emits SweepToken event on success", + "params": { + "amount": "The amount to transfer", + "to": "The address to which tokens will be transferred", + "tokenAddress": "The address of the ERC-20 token to sweep" + } + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + }, + "updateAssetsState(address,address)": { + "details": "This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address", + "params": { + "asset": "Asset address", + "comptroller": "Comptroller address (pool)" + } + } + }, + "title": "SingleTokenConverter", + "version": 1 + }, + "userdoc": { + "errors": { + "AmountInHigherThanMax(uint256,uint256)": [ + { + "notice": "Thrown when amountIn is higher than amountInMax" + } + ], + "AmountInMismatched()": [ + { + "notice": "Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens" + } + ], + "AmountOutLowerThanMinRequired(uint256,uint256)": [ + { + "notice": "Thrown when amountOut is lower than amountOutMin" + } + ], + "AmountOutMismatched()": [ + { + "notice": "Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens" + } + ], + "ConversionConfigNotEnabled()": [ + { + "notice": "Thrown when conversion is disabled or config does not exist for given pair" + } + ], + "ConversionEnabledOnlyForPrivateConversions()": [ + { + "notice": "Thrown when conversion is enabled only for private conversions" + } + ], + "ConversionTokensActive()": [ + { + "notice": "Thrown when conversion is Active" + } + ], + "ConversionTokensPaused()": [ + { + "notice": "Thrown when conversion is paused" + } + ], + "DeflationaryTokenNotSupported()": [ + { + "notice": "Thrown when using convertForExactTokens deflationary tokens" + } + ], + "IncentiveTooHigh(uint256,uint256)": [ + { + "notice": "Thrown when incentive is higher than the MAX_INCENTIVE" + } + ], + "InputLengthMisMatch()": [ + { + "notice": "Thrown when there is a mismatch in the length of input arrays" + } + ], + "InsufficientInputAmount()": [ + { + "notice": "Thrown when given input amount is zero" + } + ], + "InsufficientOutputAmount()": [ + { + "notice": "Thrown when given output amount is zero" + } + ], + "InsufficientPoolLiquidity()": [ + { + "notice": "Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa" + } + ], + "InvalidConverterNetwork()": [ + { + "notice": "When address of the ConverterNetwork is not set or Zero address" + } + ], + "InvalidMinimumAmountToConvert()": [ + { + "notice": "Thrown when minimum amount to convert is zero" + } + ], + "InvalidToAddress()": [ + { + "notice": "Thrown when address(to) is same as tokenAddressIn or tokenAddressOut" + } + ], + "InvalidTokenConfigAddresses()": [ + { + "notice": "Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination" + } + ], + "NonZeroIncentiveForPrivateConversion()": [ + { + "notice": "Thrown when trying to set non zero incentive for private conversion" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ], + "ZeroValueNotAllowed()": [ + { + "notice": "Thrown if the supplied value is 0 where it is not allowed" + } + ] + }, + "events": { + "AssetTransferredToDestination(address,address,address,uint256)": { + "notice": "Emmitted after the funds transferred to the destination address" + }, + "BaseAssetUpdated(address,address)": { + "notice": "Emitted when base asset is updated" + }, + "ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)": { + "notice": "Emitted when config is updated for tokens pair" + }, + "ConversionPaused(address)": { + "notice": "Emitted when conversion is paused" + }, + "ConversionResumed(address)": { + "notice": "Emitted when conversion is unpaused" + }, + "ConvertedExactTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when exact amount of tokens are converted for tokens" + }, + "ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when exact amount of tokens are converted for tokens, for deflationary tokens" + }, + "ConvertedForExactTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when tokens are converted for exact amount of tokens" + }, + "ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when tokens are converted for exact amount of tokens, for deflationary tokens" + }, + "ConverterNetworkAddressUpdated(address,address)": { + "notice": "Emitted when converterNetwork address is updated" + }, + "DestinationAddressUpdated(address,address)": { + "notice": "Emitted when destination address is updated" + }, + "MinAmountToConvertUpdated(uint256,uint256)": { + "notice": "Emitted when minimum amount to convert is updated" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + }, + "PriceOracleUpdated(address,address)": { + "notice": "Emitted when price oracle address is updated" + }, + "SweepToken(address,address,uint256)": { + "notice": "Event emitted when tokens are swept" + } + }, + "kind": "user", + "methods": { + "MAX_INCENTIVE()": { + "notice": "Maximum incentive could be" + }, + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "balanceOf(address)": { + "notice": "Get the balance for specific token" + }, + "baseAsset()": { + "notice": "Address of the base asset token" + }, + "conversionConfigurations(address,address)": { + "notice": "conversion configurations for the existing pairs" + }, + "conversionPaused()": { + "notice": "Boolean for if conversion is paused" + }, + "convertExactTokens(uint256,uint256,address,address,address)": { + "notice": "Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract" + }, + "convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "notice": "Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract" + }, + "convertForExactTokens(uint256,uint256,address,address,address)": { + "notice": "Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted" + }, + "convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "notice": "Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens" + }, + "converterNetwork()": { + "notice": "Address of the converterNetwork contract" + }, + "destinationAddress()": { + "notice": "Address that all incoming tokens are transferred to" + }, + "getAmountIn(uint256,address,address)": { + "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)" + }, + "getAmountOut(uint256,address,address)": { + "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut" + }, + "getUpdatedAmountIn(uint256,address,address)": { + "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut" + }, + "getUpdatedAmountOut(uint256,address,address)": { + "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn" + }, + "minAmountToConvert()": { + "notice": "Min amount to convert for private conversions. Defined in USD, with 18 decimals" + }, + "pauseConversion()": { + "notice": "Pause conversion of tokens" + }, + "priceOracle()": { + "notice": "Venus price oracle contract" + }, + "resumeConversion()": { + "notice": "Resume conversion of tokens." + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "setBaseAsset(address)": { + "notice": "Sets the base asset for the contract" + }, + "setConversionConfig(address,address,(uint256,uint8))": { + "notice": "Set the configuration for new or existing conversion pair" + }, + "setConversionConfigs(address,address[],(uint256,uint8)[])": { + "notice": "Batch sets the conversion configurations" + }, + "setConverterNetwork(address)": { + "notice": "Sets a converter network contract address" + }, + "setDestination(address)": { + "notice": "Sets a new destination address" + }, + "setMinAmountToConvert(uint256)": { + "notice": "Min amount to convert setter" + }, + "setPriceOracle(address)": { + "notice": "Sets a new price oracle" + }, + "sweepToken(address,address,uint256)": { + "notice": "To sweep ERC20 tokens and transfer them to user(to address)" + }, + "updateAssetsState(address,address)": { + "notice": "This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters" + } + }, + "notice": "SingleTokenConverter used for token conversions and sends received tokens", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 547, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_status", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 616, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 9965, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "minAmountToConvert", + "offset": 0, + "slot": "251", + "type": "t_uint256" + }, + { + "astId": 9969, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "priceOracle", + "offset": 0, + "slot": "252", + "type": "t_contract(ResilientOracle)6494" + }, + { + "astId": 9977, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "conversionConfigurations", + "offset": 0, + "slot": "253", + "type": "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)12698_storage))" + }, + { + "astId": 9980, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "destinationAddress", + "offset": 0, + "slot": "254", + "type": "t_address" + }, + { + "astId": 9983, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "conversionPaused", + "offset": 20, + "slot": "254", + "type": "t_bool" + }, + { + "astId": 9987, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "converterNetwork", + "offset": 0, + "slot": "255", + "type": "t_contract(IConverterNetwork)6767" + }, + { + "astId": 9992, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "256", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 14048, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "baseAsset", + "offset": 0, + "slot": "301", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_contract(IConverterNetwork)6767": { + "encoding": "inplace", + "label": "contract IConverterNetwork", + "numberOfBytes": "20" + }, + "t_contract(ResilientOracle)6494": { + "encoding": "inplace", + "label": "contract ResilientOracle", + "numberOfBytes": "20" + }, + "t_enum(ConversionAccessibility)12689": { + "encoding": "inplace", + "label": "enum IAbstractTokenConverter.ConversionAccessibility", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)12698_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => struct IAbstractTokenConverter.ConversionConfig))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_struct(ConversionConfig)12698_storage)" + }, + "t_mapping(t_address,t_struct(ConversionConfig)12698_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct IAbstractTokenConverter.ConversionConfig)", + "numberOfBytes": "32", + "value": "t_struct(ConversionConfig)12698_storage" + }, + "t_struct(ConversionConfig)12698_storage": { + "encoding": "inplace", + "label": "struct IAbstractTokenConverter.ConversionConfig", + "members": [ + { + "astId": 12693, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "incentive", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 12697, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "conversionAccess", + "offset": 0, + "slot": "1", + "type": "t_enum(ConversionAccessibility)12689" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/arbitrumsepolia/USDCPrimeConverter.json b/deployments/arbitrumsepolia/USDCPrimeConverter.json new file mode 100644 index 00000000..45ccfab0 --- /dev/null +++ b/deployments/arbitrumsepolia/USDCPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "transactionIndex": 5, + "gasUsed": "426902", + "logsBloom": "0x00000000000800000000000200000004800000000000000400800002000000040000000000000000000000001000000008000000000000002001201000008000000000000000000000000020001000000001000000000000000000000000000000000000020000000000000004000c00000040000000000000000000000000400000000000020000000000000000080400000040000880000000000000000000400000004000000000000004000400080000000000800800000000000000000000000000000000000000000000040000020000000000000000800000000020000000000000000000000000000000080000000880000000000000000000000000", + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583", + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000c77d0f75f1e4e3720da1d2f5d809f439125a2fd4" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000086f096b1d970990091319835faf3ee011708eae8" + ], + "data": "0x", + "logIndex": 5, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 6, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 7, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006708bad042916b47311c8078b29d7f432342102f" + ], + "data": "0x", + "logIndex": 8, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694" + ], + "data": "0x", + "logIndex": 9, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 10, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + }, + { + "transactionIndex": 5, + "blockNumber": 94296230, + "transactionHash": "0xf2449e10e017f80059a306bf17bb3609dde0ef0349c0e4ca313ebafcecb70154", + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 11, + "blockHash": "0x5783fd15956820715020af952ebd3c841c08d905f69838f3afeb690d97721583" + } + ], + "blockNumber": 94296230, + "cumulativeGasUsed": "1035285", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "0xf7013ef6000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000006708bad042916b47311c8078b29d7f432342102f000000000000000000000000e82c2c10f55d3268126c29ec813dc6f08690469400000000000000000000000086f096b1d970990091319835faf3ee011708eae80000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/USDTPrimeConverter.json b/deployments/arbitrumsepolia/USDTPrimeConverter.json new file mode 100644 index 00000000..7436173c --- /dev/null +++ b/deployments/arbitrumsepolia/USDTPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "transactionIndex": 1, + "gasUsed": "431017", + "logsBloom": "0x00000000000800000000000200000004800000000000000400800002000000040000000000000000000000001000000008000000000000002000201000008000000000000000000000000000005000000001000000000000000000000000000000000000020000000000000004000d00000000010000000000000000000000400000000000020000000000000400080400000040000080000000000000004000400000000000000000000004000400080000000000800800000000000000000000000000000000000000000000040000020000000000000000800000000020000000000000400000000000000000080000000880000000000000000000000000", + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29", + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000c77d0f75f1e4e3720da1d2f5d809f439125a2fd4" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf8" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 3, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006708bad042916b47311c8078b29d7f432342102f" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694" + ], + "data": "0x", + "logIndex": 5, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 6, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + }, + { + "transactionIndex": 1, + "blockNumber": 94296184, + "transactionHash": "0xe57b8e5fa23f488aaa9a611060112ea55601b08b99add6e038d1afc0e298573f", + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 7, + "blockHash": "0x85273d1a3b98c238128457a03bd34fd67c17b831732d014b7189bbd57ce01b29" + } + ], + "blockNumber": 94296184, + "cumulativeGasUsed": "431017", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "0xf7013ef6000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000006708bad042916b47311c8078b29d7f432342102f000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694000000000000000000000000f3118a17863996b9f2a073c9a66faaa664355cf80000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/WBTCPrimeConverter.json b/deployments/arbitrumsepolia/WBTCPrimeConverter.json new file mode 100644 index 00000000..d832bdf3 --- /dev/null +++ b/deployments/arbitrumsepolia/WBTCPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "transactionIndex": 14, + "gasUsed": "423907", + "logsBloom": "0x00000000000810000000000200000004800000000000000400800002000000040000000000000000000000001000000008000000000000002000201000008001000000000000000000000000001000000001000000000000000000000000000000001000020000000000000004000c00000000000000000000000000000000400000000000020000000000000000080400000040000080000000000000000000400000000080000000000004000400080000000000800800000004000000000000000000000040000000000000040000020000000000000000800000000020000000000000000000000000000000080000000880000000000000000000000000", + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01", + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "logs": [ + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000c77d0f75f1e4e3720da1d2f5d809f439125a2fd4" + ], + "data": "0x", + "logIndex": 14, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000fb8d93fd3cf18386a5564bb5619cd1fdb130df7d" + ], + "data": "0x", + "logIndex": 15, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 16, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 17, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006708bad042916b47311c8078b29d7f432342102f" + ], + "data": "0x", + "logIndex": 18, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694" + ], + "data": "0x", + "logIndex": 19, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 20, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + }, + { + "transactionIndex": 14, + "blockNumber": 94296281, + "transactionHash": "0x4319955e98a51c4dd2a562c3b6c262a9085cfa0744bb40e0ab544a8613a335e4", + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 21, + "blockHash": "0x016f757afae8c2edc323b20b488221bf3cd19a3dcb8cc85b67b3c54d39f17b01" + } + ], + "blockNumber": 94296281, + "cumulativeGasUsed": "3618948", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "0xf7013ef6000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000006708bad042916b47311c8078b29d7f432342102f000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694000000000000000000000000fb8d93fd3cf18386a5564bb5619cd1fdb130df7d0000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/WETHPrimeConverter.json b/deployments/arbitrumsepolia/WETHPrimeConverter.json new file mode 100644 index 00000000..e37ca3c4 --- /dev/null +++ b/deployments/arbitrumsepolia/WETHPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "transactionIndex": 6, + "gasUsed": "422472", + "logsBloom": "0x00000000000800000000000200000004800000000000000400800002000000040000000000000000000000001000000008000000000000002000201000008000000020000000000000000000001000000001000000000000000000000000000000020000020000000000008004000c00000000000000000000000000000000400000000000020000000000000000080400000044000080000000000000000000400000000000000000000004000400080000000000801800000000000000000000000000000000000000000200040000020000000000000000800000000020000000000000000000000000000000080000000880000000000000000000000000", + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6", + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "logs": [ + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000c77d0f75f1e4e3720da1d2f5d809f439125a2fd4" + ], + "data": "0x", + "logIndex": 11, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000980b62da83eff3d4576c647993b0c1d7faf17c73" + ], + "data": "0x", + "logIndex": 12, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 13, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 14, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006708bad042916b47311c8078b29d7f432342102f" + ], + "data": "0x", + "logIndex": 15, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694" + ], + "data": "0x", + "logIndex": 16, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 17, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + }, + { + "transactionIndex": 6, + "blockNumber": 94296334, + "transactionHash": "0x5da5abcbcac901d78852e594f0ae51b47c258308ca4ca195e0cb73149a3442c3", + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 18, + "blockHash": "0x40051d3cfd2047a7041742991207082e76e7beee9e043e2e67b03f78927beaa6" + } + ], + "blockNumber": 94296334, + "cumulativeGasUsed": "1626631", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "0xf7013ef6000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000006708bad042916b47311c8078b29d7f432342102f000000000000000000000000e82c2c10f55d3268126c29ec813dc6f086904694000000000000000000000000980b62da83eff3d4576c647993b0c1d7faf17c730000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/XVSVaultConverter.json b/deployments/arbitrumsepolia/XVSVaultConverter.json new file mode 100644 index 00000000..9f2a1793 --- /dev/null +++ b/deployments/arbitrumsepolia/XVSVaultConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "transactionIndex": 2, + "gasUsed": "424270", + "logsBloom": "0x00000000000800000000000200000004800000000000000400800000000000040000000000000000000000001000000008000000000000002000201040008800000000001000200000000000001000000001000000000000000000000000000002000000020000000000000004000c00000000000000000000000000000000400000000000020000000000000000080400000000000080000000000000000000400000000000000000000004000404080000000000800800000000000000000000000000000000000000000000040004020000000020000000800000000020000000000000000000000000000000000000000880400000000000000000000000", + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1", + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "logs": [ + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000c77d0f75f1e4e3720da1d2f5d809f439125a2fd4" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000877dc896e7b13096d3827872e396927bbe704407" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 5, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000006708bad042916b47311c8078b29d7f432342102f" + ], + "data": "0x", + "logIndex": 6, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000309b71a417da9cfa8ac47e6038000b1739d9a3a6" + ], + "data": "0x", + "logIndex": 7, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 8, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + }, + { + "transactionIndex": 2, + "blockNumber": 94296375, + "transactionHash": "0xdc3ae90f2516feb2055784b6e8af74e420de68f50045e1e0e4d2cc26fe25dfbc", + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 9, + "blockHash": "0x3579ade75d53864c6c7b1b95cfce4b79606de0a89a52e447065980e83fe5fdb1" + } + ], + "blockNumber": 94296375, + "cumulativeGasUsed": "519704", + "status": 1, + "byzantium": true + }, + "args": [ + "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "0xf7013ef6000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000006708bad042916b47311c8078b29d7f432342102f000000000000000000000000309b71a417da9cfa8ac47e6038000b1739d9a3a6000000000000000000000000877dc896e7b13096d3827872e396927bbe7044070000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} From ebaab0cba32baa04da18304861dc5c967341878d Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 4 Nov 2024 16:48:51 +0530 Subject: [PATCH 04/24] feat: deployment files for the converter network on arbitrum sepolia --- .../arbitrumsepolia/ConverterNetwork.json | 723 +++++++++++++++ .../ConverterNetwork_Implementation.json | 828 ++++++++++++++++++ .../ConverterNetwork_Proxy.json | 277 ++++++ 3 files changed, 1828 insertions(+) create mode 100644 deployments/arbitrumsepolia/ConverterNetwork.json create mode 100644 deployments/arbitrumsepolia/ConverterNetwork_Implementation.json create mode 100644 deployments/arbitrumsepolia/ConverterNetwork_Proxy.json diff --git a/deployments/arbitrumsepolia/ConverterNetwork.json b/deployments/arbitrumsepolia/ConverterNetwork.json new file mode 100644 index 00000000..35e9de7b --- /dev/null +++ b/deployments/arbitrumsepolia/ConverterNetwork.json @@ -0,0 +1,723 @@ +{ + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "ConverterAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + } + ], + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConvertersForConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "transactionIndex": 1, + "gasUsed": "892060", + "logsBloom": "0x00000000000000000000000200000000400000000000000400800800000000040000000000000000000000000000000000000000000000000000000000008000000000000000000000000200000002000001000000000000000000000020000000000000020000000000000000000800080000800000000000000000000000400000000000000000000000000080000000000000000080000000000000800000000000000000000000002000000400000000000000800000000001000000000000000020000000000000000001040000000000000400000000000000000020000000000200000000000000000000000000000800000000000000000000000000", + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120", + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000a5fd972d51ac9a74bb02e9072ce8b3ec33bfb832" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 2, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 3, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a78a1df376c3ceebc5fab574fe6eddbbf76fd03e", + "logIndex": 5, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + } + ], + "blockNumber": 94298904, + "cumulativeGasUsed": "892060", + "status": 1, + "byzantium": true + }, + "args": [ + "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", + "0xcd6dc687000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": ["0xa36AD96441cB931D8dFEAAaC97D3FaB4B39E590F", 20] + }, + "implementation": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumsepolia/ConverterNetwork_Implementation.json b/deployments/arbitrumsepolia/ConverterNetwork_Implementation.json new file mode 100644 index 00000000..1c63d7c2 --- /dev/null +++ b/deployments/arbitrumsepolia/ConverterNetwork_Implementation.json @@ -0,0 +1,828 @@ +{ + "address": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConverterAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + } + ], + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConvertersForConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xa94ec929a3f70b001e1d7a329293e4a28a3efec86568cf6f38a5e4fc4ff178a6", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "transactionIndex": 1, + "gasUsed": "1985279", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000004000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000", + "blockHash": "0xfe837de8527f0702ff0ae948c73804a47a4cf38e8033d5ec3559c2a73ce2b1cb", + "transactionHash": "0xa94ec929a3f70b001e1d7a329293e4a28a3efec86568cf6f38a5e4fc4ff178a6", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94298892, + "transactionHash": "0xa94ec929a3f70b001e1d7a329293e4a28a3efec86568cf6f38a5e4fc4ff178a6", + "address": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0xfe837de8527f0702ff0ae948c73804a47a4cf38e8033d5ec3559c2a73ce2b1cb" + } + ], + "blockNumber": 94298892, + "cumulativeGasUsed": "1985279", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "176b6b19adc371c32ad674fe4863e12d", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConverterAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConverterDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"loopsLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidMaxLoopsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConverterAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"loopsLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredLoops\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converter\",\"type\":\"address\"}],\"name\":\"ConverterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converter\",\"type\":\"address\"}],\"name\":\"ConverterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMaxLoopsLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newmaxLoopsLimit\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IAbstractTokenConverter\",\"name\":\"_tokenConverter\",\"type\":\"address\"}],\"name\":\"addTokenConverter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"allConverters\",\"outputs\":[{\"internalType\":\"contract IAbstractTokenConverter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenAddressOut\",\"type\":\"address\"}],\"name\":\"findTokenConverters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"converters\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"convertersBalance\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenAddressOut\",\"type\":\"address\"}],\"name\":\"findTokenConvertersForConverters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"converters\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"convertersBalance\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllConverters\",\"outputs\":[{\"internalType\":\"contract IAbstractTokenConverter[]\",\"name\":\"converters\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_loopsLimit\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenConverter\",\"type\":\"address\"}],\"name\":\"isTokenConverter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isConverter\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLoopsLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IAbstractTokenConverter\",\"name\":\"_tokenConverter\",\"type\":\"address\"}],\"name\":\"removeTokenConverter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"setMaxLoopsLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"addTokenConverter(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"ConverterAdded is emitted on success\",\"params\":{\"_tokenConverter\":\"Address of the token converter\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"findTokenConverters(address,address)\":{\"params\":{\"_tokenAddressIn\":\"Address of tokenIn\",\"_tokenAddressOut\":\"Address of tokenOut\"},\"returns\":{\"converters\":\"Array of the conveters on the basis of the tokens pair\",\"convertersBalance\":\"Array of balances with respect to token out\"}},\"findTokenConvertersForConverters(address,address)\":{\"params\":{\"_tokenAddressIn\":\"Address of tokenIn\",\"_tokenAddressOut\":\"Address of tokenOut\"},\"returns\":{\"converters\":\"Array of the conveters on the basis of the tokens pair\",\"convertersBalance\":\"Array of balances with respect to token out\"}},\"getAllConverters()\":{\"returns\":{\"converters\":\"Array containing all the converters addresses\"}},\"initialize(address,uint256)\":{\"custom:error\":\"InvalidMaxLoopsLimit is thrown when when loops limit is invalid\",\"custom:event\":\"ConverterAdded is emitted for each converter added on success\",\"params\":{\"_accessControlManager\":\"The address of ACM contract\",\"_loopsLimit\":\"Limit for the loops in the contract to avoid DOS\"}},\"isTokenConverter(address)\":{\"params\":{\"_tokenConverter\":\"Address of the token converter\"},\"returns\":{\"isConverter\":\"true if given address is converter otherwise false\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"removeTokenConverter(address)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ConverterDoesNotExist is thrown when converter to remove does not exist\",\"custom:event\":\"ConverterRemoved is emitted on success\",\"params\":{\"_tokenConverter\":\"Address of the token converter\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setMaxLoopsLimit(uint256)\":{\"custom:access\":\"Only owner\",\"custom:error\":\"InvalidMaxLoopsLimit is thrown when when loops limit is invalid\",\"params\":{\"limit\":\"Limit for the max loops can execute at a time\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"title\":\"ConverterNetwork\",\"version\":1},\"userdoc\":{\"errors\":{\"ConverterAlreadyExists()\":[{\"notice\":\"Error thrown when converter already exists\"}],\"ConverterDoesNotExist()\":[{\"notice\":\"Error thrown converter does not exist\"}],\"InvalidMaxLoopsLimit(uint256)\":[{\"notice\":\"Error thrown when loops limit is invalid\"}],\"InvalidTokenConverterAddress()\":[{\"notice\":\"Error thrown when converter address is invalid\"}],\"MaxLoopsLimitExceeded(uint256,uint256)\":[{\"notice\":\"Thrown an error on maxLoopsLimit exceeds for any loop\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}]},\"events\":{\"ConverterAdded(address)\":{\"notice\":\"Emitted when new converter is added\"},\"ConverterRemoved(address)\":{\"notice\":\"Emitted when converter is removed\"},\"MaxLoopsLimitUpdated(uint256,uint256)\":{\"notice\":\"Emitted when max loops limit is set\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"}},\"kind\":\"user\",\"methods\":{\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"addTokenConverter(address)\":{\"notice\":\"Adds new converter to the array\"},\"allConverters(uint256)\":{\"notice\":\"Array holding all the converters\"},\"findTokenConverters(address,address)\":{\"notice\":\"Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to users for conversion\"},\"findTokenConvertersForConverters(address,address)\":{\"notice\":\"Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to converters for conversion.\"},\"getAllConverters()\":{\"notice\":\"This function returns the array containing all the converters addresses\"},\"initialize(address,uint256)\":{\"notice\":\"ConverterNetwork initializer\"},\"isTokenConverter(address)\":{\"notice\":\"This function checks if the given address is a converter or not\"},\"removeTokenConverter(address)\":{\"notice\":\"Removes converter from the array\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setMaxLoopsLimit(uint256)\":{\"notice\":\"Set the limit for the loops can iterate to avoid the DOS\"}},\"notice\":\"ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/ConverterNetwork.sol\":\"ConverterNetwork\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x005e52885b8f7935dbccb1c87847229a9a2bfb66fd75fe200c9ec6f8a5d7a0e9\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2432799b0d824fc701beb4c30146e912b9aeecf77b5c1635dde6c5fbe6bfc3a7\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x6e71c3df86501df5c0e4bace1333c0c91f9f9cced252a54fb99eeda219b789d5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/**\\n * @title MaxLoopsLimitHelper\\n * @author Venus\\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\\n */\\nabstract contract MaxLoopsLimitHelper {\\n // Limit for the loops to avoid the DOS\\n uint256 public maxLoopsLimit;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when max loops limit is set\\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\\n\\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\\n\\n /**\\n * @notice Set the limit for the loops can iterate to avoid the DOS\\n * @param limit Limit for the max loops can execute at a time\\n */\\n function _setMaxLoopsLimit(uint256 limit) internal {\\n require(limit > maxLoopsLimit, \\\"Comptroller: Invalid maxLoopsLimit\\\");\\n\\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\\n maxLoopsLimit = limit;\\n\\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\\n }\\n\\n /**\\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\\n * @param len Length of the loops iterate\\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\\n */\\n function _ensureMaxLoops(uint256 len) internal view {\\n if (len > maxLoopsLimit) {\\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4c25e30635485d162177effa384eee51768b0141a567a0da16ff6ad673274166\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd9a747f176d9b9de220331b87ed711cc2bd594a118b538a35f3c47060bff7a8b\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/ConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { MaxLoopsLimitHelper } from \\\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { sort } from \\\"../Utils/ArrayHelpers.sol\\\";\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title ConverterNetwork\\n/// @author Venus\\n/// @notice ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract ConverterNetwork is IConverterNetwork, AccessControlledV8, MaxLoopsLimitHelper {\\n /// @notice Array holding all the converters\\n IAbstractTokenConverter[] public allConverters;\\n\\n /// @notice Emitted when new converter is added\\n event ConverterAdded(address indexed converter);\\n\\n /// @notice Emitted when converter is removed\\n event ConverterRemoved(address indexed converter);\\n\\n /// @notice Error thrown when converter already exists\\n error ConverterAlreadyExists();\\n\\n /// @notice Error thrown converter does not exist\\n error ConverterDoesNotExist();\\n\\n /// @notice Error thrown when converter address is invalid\\n error InvalidTokenConverterAddress();\\n\\n /// @notice Error thrown when loops limit is invalid\\n error InvalidMaxLoopsLimit(uint256 loopsLimit);\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @notice ConverterNetwork initializer\\n /// @param _accessControlManager The address of ACM contract\\n /// @param _loopsLimit Limit for the loops in the contract to avoid DOS\\n /// @custom:event ConverterAdded is emitted for each converter added on success\\n /// @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\\n ensureNonzeroAddress(_accessControlManager);\\n __AccessControlled_init(_accessControlManager);\\n\\n if (_loopsLimit >= type(uint128).max) revert InvalidMaxLoopsLimit(_loopsLimit);\\n _setMaxLoopsLimit(_loopsLimit);\\n }\\n\\n /**\\n * @notice Set the limit for the loops can iterate to avoid the DOS\\n * @param limit Limit for the max loops can execute at a time\\n * @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\\n * @custom:access Only owner\\n */\\n function setMaxLoopsLimit(uint256 limit) external onlyOwner {\\n if (limit >= type(uint128).max) revert InvalidMaxLoopsLimit(limit);\\n _setMaxLoopsLimit(limit);\\n }\\n\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n /// @custom:event ConverterAdded is emitted on success\\n /// @custom:access Only Governance\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external {\\n _checkAccessAllowed(\\\"addTokenConverter(address)\\\");\\n _addTokenConverter(_tokenConverter);\\n }\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n /// @custom:error ConverterDoesNotExist is thrown when converter to remove does not exist\\n /// @custom:event ConverterRemoved is emitted on success\\n /// @custom:access Only Governance\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external {\\n _checkAccessAllowed(\\\"removeTokenConverter(address)\\\");\\n\\n // Find the index of the converter in the array\\n uint128 indexToRemove = _findConverterIndex(_tokenConverter);\\n\\n // Ensure that the converter exists in the array\\n if (indexToRemove == type(uint128).max) revert ConverterDoesNotExist();\\n\\n // Swap the element to remove with the last element\\n allConverters[indexToRemove] = allConverters[allConverters.length - 1];\\n\\n // Remove the last element (which is now a duplicate)\\n allConverters.pop();\\n\\n emit ConverterRemoved(address(_tokenConverter));\\n }\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// It will return the converters which are open to users for conversion\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance)\\n {\\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, false);\\n }\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// It will return the converters which are open to converters for conversion.\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance)\\n {\\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, true);\\n }\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return converters Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory converters) {\\n converters = allConverters;\\n }\\n\\n /// @notice This function checks if the given address is a converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return isConverter true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool isConverter) {\\n uint128 index = _findConverterIndex(IAbstractTokenConverter(_tokenConverter));\\n\\n if (index != type(uint128).max) {\\n isConverter = true;\\n }\\n }\\n\\n /// @notice Adds new converter contract to the array\\n /// @param _tokenConverter Address of the token converter\\n /// @custom:error ConverterAlreadyExists is thrown when new tokenconverter to add already exists\\n /// @custom:event ConverterAdded is emitted on success\\n function _addTokenConverter(IAbstractTokenConverter _tokenConverter) internal {\\n if (\\n (address(_tokenConverter) == address(0)) || (address(_tokenConverter.converterNetwork()) != address(this))\\n ) {\\n revert InvalidTokenConverterAddress();\\n }\\n\\n uint128 index = _findConverterIndex(_tokenConverter);\\n if (index != type(uint128).max) revert ConverterAlreadyExists();\\n\\n allConverters.push(_tokenConverter);\\n _ensureMaxLoops(allConverters.length);\\n\\n emit ConverterAdded(address(_tokenConverter));\\n }\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @param forConverters Bool to filter out converters on the basis of the conversionAccess\\n /// @return converters Array of converters\\n /// @return convertersBalance Array of balances with respect to token out\\n function _findTokenConverters(\\n address _tokenAddressIn,\\n address _tokenAddressOut,\\n bool forConverters\\n ) internal returns (address[] memory converters, uint256[] memory convertersBalance) {\\n uint128 convertersLength = uint128(allConverters.length);\\n\\n // Create a dynamic array to store the matching converters\\n converters = new address[](convertersLength);\\n convertersBalance = new uint256[](convertersLength);\\n uint128 count;\\n\\n for (uint128 i; i < convertersLength; ) {\\n IAbstractTokenConverter converter = allConverters[i];\\n\\n unchecked {\\n ++i;\\n }\\n\\n if ((address(converter.converterNetwork()) != address(this)) || msg.sender == address(converter)) {\\n continue;\\n }\\n\\n (, IAbstractTokenConverter.ConversionAccessibility conversionAccess) = converter.conversionConfigurations(\\n _tokenAddressIn,\\n _tokenAddressOut\\n );\\n\\n if (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ALL) {\\n converters[count] = address(converter);\\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\\n ++count;\\n } else if (\\n forConverters &&\\n (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_CONVERTERS)\\n ) {\\n converters[count] = address(converter);\\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\\n ++count;\\n } else if (\\n !forConverters && (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_USERS)\\n ) {\\n converters[count] = address(converter);\\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\\n ++count;\\n }\\n }\\n\\n // Resize the array to the actual number of matching converters\\n assembly {\\n mstore(converters, count)\\n mstore(convertersBalance, count)\\n }\\n sort(convertersBalance, converters);\\n }\\n\\n /// @notice Used to get the index of the converter stored in the array\\n /// This will return the index if the converter exists in the array otherwise will return type(uint128).max\\n /// @param _tokenConverter Address of the token converter\\n /// @return index of the converter address in the allConverters array\\n function _findConverterIndex(IAbstractTokenConverter _tokenConverter) internal view returns (uint128 index) {\\n index = type(uint128).max; // Not found, return a large value\\n\\n uint128 convertersLength = uint128(allConverters.length);\\n for (uint128 i; i < convertersLength; ) {\\n if (allConverters[i] == _tokenConverter) {\\n index = i;\\n }\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe9fdf8e3af51249c162e37c946b8966f4b9ccec719201c8fd4258cb89c6d294\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0x7852d4f8a6dd1c80d14342f8ff2e26f723eb00c888e9a9e50a5fe8f95c59200c\",\"license\":\"BSD-3-Clause\"},\"contracts/Utils/ArrayHelpers.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Used to sort addresses array based on their token balances\\n/// @param arr Array of token balances of different addresses\\n/// @param addrs Array containing these addresses\\nfunction sort(uint256[] memory arr, address[] memory addrs) pure {\\n if (arr.length > 1) {\\n return quickSortDescending(arr, addrs, 0, arr.length - 1);\\n }\\n}\\n\\n/// @notice Used to sort addresses array based on their token balances\\n/// @param arr Array of token balances of different addresses\\n/// @param addrs Array containing these addresses\\n/// @param left index of first value\\n/// @param right index of last value\\nfunction quickSortDescending(\\n uint256[] memory arr,\\n address[] memory addrs,\\n uint256 left,\\n uint256 right\\n) pure {\\n if (left >= right) return;\\n uint256 p = arr[(left + right) / 2]; // p = the pivot element\\n uint256 i = left;\\n uint256 j = right;\\n while (i < j) {\\n while (arr[i] > p) ++i;\\n while (arr[j] < p) --j; // arr[j] < p means p still to the right, so j > 0\\n if (arr[i] < arr[j]) {\\n (arr[i], arr[j]) = (arr[j], arr[i]);\\n (addrs[i], addrs[j]) = (addrs[j], addrs[i]);\\n } else {\\n ++i;\\n }\\n }\\n\\n if (j > left) quickSortDescending(arr, addrs, left, j - 1); // j > left, so j > 0\\n quickSortDescending(arr, addrs, j + 1, right);\\n}\\n\",\"keccak256\":\"0xc52f21116bbc94532e4022f72980d2605f8ec7580a82d87aaaebf893ba03c2f7\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x6080604052348015600f57600080fd5b506016601a565b60d7565b600054610100900460ff161560855760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161460d5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6120ae806100e66000396000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c806380d45a2d116100b2578063be26317e11610081578063e30c397811610066578063e30c39781461027e578063f2fde38b1461029c578063f49e746f146102af57600080fd5b8063be26317e14610254578063cd6dc6871461026b57600080fd5b806380d45a2d146101f25780638da5cb5b14610205578063932fd98514610223578063b4a0bdf31461023657600080fd5b80634e9f8f39116100ee5780634e9f8f39146101ac5780636c059fb1146101bf578063715018a6146101e257806379ba5097146101ea57600080fd5b80630e32cb861461012057806325a31b6b14610135578063285510e9146101535780633119e7c71461018b575b600080fd5b61013361012e366004611b9f565b6102c2565b005b61013d6102d6565b60405161014a9190611bc3565b60405180910390f35b610166610161366004611c1d565b610345565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014a565b61019e610199366004611c36565b61037c565b60405161014a929190611c6f565b61019e6101ba366004611c36565b610396565b6101d26101cd366004611b9f565b6103a5565b604051901515815260200161014a565b6101336103d7565b6101336103eb565b610133610200366004611c1d565b6104a2565b60335473ffffffffffffffffffffffffffffffffffffffff16610166565b610133610231366004611b9f565b6104ff565b60975473ffffffffffffffffffffffffffffffffffffffff16610166565b61025d60c95481565b60405190815260200161014a565b610133610279366004611d00565b610546565b60655473ffffffffffffffffffffffffffffffffffffffff16610166565b6101336102aa366004611b9f565b610739565b6101336102bd366004611b9f565b6107e9565b6102ca610a00565b6102d381610a81565b50565b606060fb80548060200260200160405190810160405280929190818152602001828054801561033b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610310575b5050505050905090565b60fb818154811061035557600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60608061038b84846000610bab565b909590945092505050565b60608061038b84846001610bab565b6000806103b183611100565b90506fffffffffffffffffffffffffffffffff808216146103d157600191505b50919050565b6103df610a00565b6103e960006111ba565b565b606554339073ffffffffffffffffffffffffffffffffffffffff168114610499576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102d3816111ba565b6104aa610a00565b6fffffffffffffffffffffffffffffffff81106104f6576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101829052602401610490565b6102d3816111eb565b61053d6040518060400160405280601a81526020017f616464546f6b656e436f6e7665727465722861646472657373290000000000008152506112ba565b6102d381611397565b600054610100900460ff16158080156105665750600054600160ff909116105b806105805750303b158015610580575060005460ff166001145b61060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610490565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561066a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610673836115a3565b61067c836115f0565b6fffffffffffffffffffffffffffffffff82106106c8576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101839052602401610490565b6106d1826111eb565b801561073457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610741610a00565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556107a460335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6108276040518060400160405280601d81526020017f72656d6f7665546f6b656e436f6e7665727465722861646472657373290000008152506112ba565b600061083282611100565b90507fffffffffffffffffffffffffffffffff000000000000000000000000000000016fffffffffffffffffffffffffffffffff82160161089f576040517f2516fa2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb80546108af90600190611d5b565b815481106108bf576108bf611d74565b60009182526020909120015460fb805473ffffffffffffffffffffffffffffffffffffffff909216916fffffffffffffffffffffffffffffffff841690811061090a5761090a611d74565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060fb80548061096357610963611da3565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917febba5edf297d79cea0ec18d97adacf578cc3152240bd112e8d7da26ba65700d191a25050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146103e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8116610b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610490565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b60fb5460609081906fffffffffffffffffffffffffffffffff811667ffffffffffffffff811115610bde57610bde611dd2565b604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509250806fffffffffffffffffffffffffffffffff1667ffffffffffffffff811115610c3557610c35611dd2565b604051908082528060200260200182016040528015610c5e578160200160208202803683370190505b5091506000805b826fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156110e557600060fb826fffffffffffffffffffffffffffffffff1681548110610cb857610cb8611d74565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160010191503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d739190611e01565b73ffffffffffffffffffffffffffffffffffffffff16141580610dab57503373ffffffffffffffffffffffffffffffffffffffff8216145b15610db65750610c65565b6040517fb491ddf700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015289811660248301526000919083169063b491ddf79060440160408051808303816000875af1158015610e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e539190611e1e565b915060019050816003811115610e6b57610e6b611e47565b03610f73578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f349190611e76565b86856fffffffffffffffffffffffffffffffff1681518110610f5857610f58611d74565b6020908102919091010152610f6c84611e8f565b93506110de565b878015610f9157506002816003811115610f8f57610f8f611e47565b145b15610fbb578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b87158015610fda57506003816003811115610fd857610fd8611e47565b145b156110de578187856fffffffffffffffffffffffffffffffff168151811061100457611004611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa15801561107f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a39190611e76565b86856fffffffffffffffffffffffffffffffff16815181106110c7576110c7611d74565b60209081029190910101526110db84611e8f565b93505b5050610c65565b508084528083526110f68385611698565b5050935093915050565b60fb546fffffffffffffffffffffffffffffffff9060005b816fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156111b3578373ffffffffffffffffffffffffffffffffffffffff1660fb826fffffffffffffffffffffffffffffffff168154811061118057611180611d74565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16036111ab578092505b600101611118565b5050919050565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556102d3816116bc565b60c954811161127c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610490565b60c980549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101610b9f565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906113139033908690600401611f22565b602060405180830381865afa158015611330573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113549190611f59565b905080611393573330836040517f4a3fa29300000000000000000000000000000000000000000000000000000000815260040161049093929190611f7b565b5050565b73ffffffffffffffffffffffffffffffffffffffff8116158061145657503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190611e01565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561148d576040517f36e7473200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061149882611100565b90506fffffffffffffffffffffffffffffffff808216146114e5576040517f0aef5e8600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb805460018101825560008290527f3e7257b7272bb46d49cd6019b04ddee20da7c0cb13f7c1ec3391291b2ccebabc0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555461155e90611733565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fa0a158044a2552256f6415ce60c2ef0d6983a67f58e491cd7af6e48ae2abe25f90600090a25050565b73ffffffffffffffffffffffffffffffffffffffff81166102d3576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054610100900460ff16611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b61168f61177d565b6102d38161181c565b6001825111156113935761139382826000600186516116b79190611d5b565b6118b3565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c9548111156102d35760c9546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610490565b600054610100900460ff16611814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9611add565b600054610100900460ff166102ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b80821015611ad75760008460026118ca8486611fbd565b6118d49190611fd0565b815181106118e4576118e4611d74565b6020908102919091010151905082825b80821015611aa4575b8287838151811061191057611910611d74565b6020026020010151111561192e576119278261200b565b91506118fd565b8287828151811061194157611941611d74565b6020026020010151101561195f5761195881612043565b905061192e565b86818151811061197157611971611d74565b602002602001015187838151811061198b5761198b611d74565b60200260200101511015611a94578681815181106119ab576119ab611d74565b60200260200101518783815181106119c5576119c5611d74565b60200260200101518884815181106119df576119df611d74565b602002602001018984815181106119f8576119f8611d74565b6020026020010182815250828152505050858181518110611a1b57611a1b611d74565b6020026020010151868381518110611a3557611a35611d74565b6020026020010151878481518110611a4f57611a4f611d74565b60200260200101888481518110611a6857611a68611d74565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690526118f4565b611a9d8261200b565b91506118f4565b84811115611abd57611abd8787876116b7600186611d5b565b611ad38787611acd846001611fbd565b876118b3565b5050505b50505050565b600054610100900460ff16611b74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9336111ba565b73ffffffffffffffffffffffffffffffffffffffff811681146102d357600080fd5b600060208284031215611bb157600080fd5b8135611bbc81611b7d565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015611c1157835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611bdf565b50909695505050505050565b600060208284031215611c2f57600080fd5b5035919050565b60008060408385031215611c4957600080fd5b8235611c5481611b7d565b91506020830135611c6481611b7d565b809150509250929050565b604080825283519082018190526000906020906060840190828701845b82811015611cbe57815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101611c8c565b5050508381038285015284518082528583019183019060005b81811015611cf357835183529284019291840191600101611cd7565b5090979650505050505050565b60008060408385031215611d1357600080fd5b8235611d1e81611b7d565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115611d6e57611d6e611d2c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215611e1357600080fd5b8151611bbc81611b7d565b60008060408385031215611e3157600080fd5b82519150602083015160048110611c6457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600060208284031215611e8857600080fd5b5051919050565b60006fffffffffffffffffffffffffffffffff808316818103611eb457611eb4611d2c565b6001019392505050565b6000815180845260005b81811015611ee457602081850181015186830182015201611ec8565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611f516040830184611ebe565b949350505050565b600060208284031215611f6b57600080fd5b81518015158114611bbc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808616835280851660208401525060606040830152611fb46060830184611ebe565b95945050505050565b80820180821115611d6e57611d6e611d2c565b600082612006577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361203c5761203c611d2c565b5060010190565b60008161205257612052611d2c565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea264697066735822122043fe620950a480d860f29545b04e4166e48b1a7cedd58d8784b99cbba91f803b64736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061011b5760003560e01c806380d45a2d116100b2578063be26317e11610081578063e30c397811610066578063e30c39781461027e578063f2fde38b1461029c578063f49e746f146102af57600080fd5b8063be26317e14610254578063cd6dc6871461026b57600080fd5b806380d45a2d146101f25780638da5cb5b14610205578063932fd98514610223578063b4a0bdf31461023657600080fd5b80634e9f8f39116100ee5780634e9f8f39146101ac5780636c059fb1146101bf578063715018a6146101e257806379ba5097146101ea57600080fd5b80630e32cb861461012057806325a31b6b14610135578063285510e9146101535780633119e7c71461018b575b600080fd5b61013361012e366004611b9f565b6102c2565b005b61013d6102d6565b60405161014a9190611bc3565b60405180910390f35b610166610161366004611c1d565b610345565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014a565b61019e610199366004611c36565b61037c565b60405161014a929190611c6f565b61019e6101ba366004611c36565b610396565b6101d26101cd366004611b9f565b6103a5565b604051901515815260200161014a565b6101336103d7565b6101336103eb565b610133610200366004611c1d565b6104a2565b60335473ffffffffffffffffffffffffffffffffffffffff16610166565b610133610231366004611b9f565b6104ff565b60975473ffffffffffffffffffffffffffffffffffffffff16610166565b61025d60c95481565b60405190815260200161014a565b610133610279366004611d00565b610546565b60655473ffffffffffffffffffffffffffffffffffffffff16610166565b6101336102aa366004611b9f565b610739565b6101336102bd366004611b9f565b6107e9565b6102ca610a00565b6102d381610a81565b50565b606060fb80548060200260200160405190810160405280929190818152602001828054801561033b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610310575b5050505050905090565b60fb818154811061035557600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60608061038b84846000610bab565b909590945092505050565b60608061038b84846001610bab565b6000806103b183611100565b90506fffffffffffffffffffffffffffffffff808216146103d157600191505b50919050565b6103df610a00565b6103e960006111ba565b565b606554339073ffffffffffffffffffffffffffffffffffffffff168114610499576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102d3816111ba565b6104aa610a00565b6fffffffffffffffffffffffffffffffff81106104f6576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101829052602401610490565b6102d3816111eb565b61053d6040518060400160405280601a81526020017f616464546f6b656e436f6e7665727465722861646472657373290000000000008152506112ba565b6102d381611397565b600054610100900460ff16158080156105665750600054600160ff909116105b806105805750303b158015610580575060005460ff166001145b61060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610490565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561066a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610673836115a3565b61067c836115f0565b6fffffffffffffffffffffffffffffffff82106106c8576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101839052602401610490565b6106d1826111eb565b801561073457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610741610a00565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556107a460335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6108276040518060400160405280601d81526020017f72656d6f7665546f6b656e436f6e7665727465722861646472657373290000008152506112ba565b600061083282611100565b90507fffffffffffffffffffffffffffffffff000000000000000000000000000000016fffffffffffffffffffffffffffffffff82160161089f576040517f2516fa2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb80546108af90600190611d5b565b815481106108bf576108bf611d74565b60009182526020909120015460fb805473ffffffffffffffffffffffffffffffffffffffff909216916fffffffffffffffffffffffffffffffff841690811061090a5761090a611d74565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060fb80548061096357610963611da3565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917febba5edf297d79cea0ec18d97adacf578cc3152240bd112e8d7da26ba65700d191a25050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146103e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8116610b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610490565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b60fb5460609081906fffffffffffffffffffffffffffffffff811667ffffffffffffffff811115610bde57610bde611dd2565b604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509250806fffffffffffffffffffffffffffffffff1667ffffffffffffffff811115610c3557610c35611dd2565b604051908082528060200260200182016040528015610c5e578160200160208202803683370190505b5091506000805b826fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156110e557600060fb826fffffffffffffffffffffffffffffffff1681548110610cb857610cb8611d74565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160010191503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d739190611e01565b73ffffffffffffffffffffffffffffffffffffffff16141580610dab57503373ffffffffffffffffffffffffffffffffffffffff8216145b15610db65750610c65565b6040517fb491ddf700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015289811660248301526000919083169063b491ddf79060440160408051808303816000875af1158015610e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e539190611e1e565b915060019050816003811115610e6b57610e6b611e47565b03610f73578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f349190611e76565b86856fffffffffffffffffffffffffffffffff1681518110610f5857610f58611d74565b6020908102919091010152610f6c84611e8f565b93506110de565b878015610f9157506002816003811115610f8f57610f8f611e47565b145b15610fbb578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b87158015610fda57506003816003811115610fd857610fd8611e47565b145b156110de578187856fffffffffffffffffffffffffffffffff168151811061100457611004611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa15801561107f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a39190611e76565b86856fffffffffffffffffffffffffffffffff16815181106110c7576110c7611d74565b60209081029190910101526110db84611e8f565b93505b5050610c65565b508084528083526110f68385611698565b5050935093915050565b60fb546fffffffffffffffffffffffffffffffff9060005b816fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156111b3578373ffffffffffffffffffffffffffffffffffffffff1660fb826fffffffffffffffffffffffffffffffff168154811061118057611180611d74565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16036111ab578092505b600101611118565b5050919050565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556102d3816116bc565b60c954811161127c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610490565b60c980549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101610b9f565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906113139033908690600401611f22565b602060405180830381865afa158015611330573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113549190611f59565b905080611393573330836040517f4a3fa29300000000000000000000000000000000000000000000000000000000815260040161049093929190611f7b565b5050565b73ffffffffffffffffffffffffffffffffffffffff8116158061145657503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190611e01565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561148d576040517f36e7473200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061149882611100565b90506fffffffffffffffffffffffffffffffff808216146114e5576040517f0aef5e8600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb805460018101825560008290527f3e7257b7272bb46d49cd6019b04ddee20da7c0cb13f7c1ec3391291b2ccebabc0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555461155e90611733565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fa0a158044a2552256f6415ce60c2ef0d6983a67f58e491cd7af6e48ae2abe25f90600090a25050565b73ffffffffffffffffffffffffffffffffffffffff81166102d3576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054610100900460ff16611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b61168f61177d565b6102d38161181c565b6001825111156113935761139382826000600186516116b79190611d5b565b6118b3565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c9548111156102d35760c9546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610490565b600054610100900460ff16611814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9611add565b600054610100900460ff166102ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b80821015611ad75760008460026118ca8486611fbd565b6118d49190611fd0565b815181106118e4576118e4611d74565b6020908102919091010151905082825b80821015611aa4575b8287838151811061191057611910611d74565b6020026020010151111561192e576119278261200b565b91506118fd565b8287828151811061194157611941611d74565b6020026020010151101561195f5761195881612043565b905061192e565b86818151811061197157611971611d74565b602002602001015187838151811061198b5761198b611d74565b60200260200101511015611a94578681815181106119ab576119ab611d74565b60200260200101518783815181106119c5576119c5611d74565b60200260200101518884815181106119df576119df611d74565b602002602001018984815181106119f8576119f8611d74565b6020026020010182815250828152505050858181518110611a1b57611a1b611d74565b6020026020010151868381518110611a3557611a35611d74565b6020026020010151878481518110611a4f57611a4f611d74565b60200260200101888481518110611a6857611a68611d74565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690526118f4565b611a9d8261200b565b91506118f4565b84811115611abd57611abd8787876116b7600186611d5b565b611ad38787611acd846001611fbd565b876118b3565b5050505b50505050565b600054610100900460ff16611b74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9336111ba565b73ffffffffffffffffffffffffffffffffffffffff811681146102d357600080fd5b600060208284031215611bb157600080fd5b8135611bbc81611b7d565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015611c1157835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611bdf565b50909695505050505050565b600060208284031215611c2f57600080fd5b5035919050565b60008060408385031215611c4957600080fd5b8235611c5481611b7d565b91506020830135611c6481611b7d565b809150509250929050565b604080825283519082018190526000906020906060840190828701845b82811015611cbe57815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101611c8c565b5050508381038285015284518082528583019183019060005b81811015611cf357835183529284019291840191600101611cd7565b5090979650505050505050565b60008060408385031215611d1357600080fd5b8235611d1e81611b7d565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115611d6e57611d6e611d2c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215611e1357600080fd5b8151611bbc81611b7d565b60008060408385031215611e3157600080fd5b82519150602083015160048110611c6457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600060208284031215611e8857600080fd5b5051919050565b60006fffffffffffffffffffffffffffffffff808316818103611eb457611eb4611d2c565b6001019392505050565b6000815180845260005b81811015611ee457602081850181015186830182015201611ec8565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611f516040830184611ebe565b949350505050565b600060208284031215611f6b57600080fd5b81518015158114611bbc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808616835280851660208401525060606040830152611fb46060830184611ebe565b95945050505050565b80820180821115611d6e57611d6e611d2c565b600082612006577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361203c5761203c611d2c565b5060010190565b60008161205257612052611d2c565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea264697066735822122043fe620950a480d860f29545b04e4166e48b1a7cedd58d8784b99cbba91f803b64736f6c63430008190033", + "devdoc": { + "author": "Venus", + "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "addTokenConverter(address)": { + "custom:access": "Only Governance", + "custom:event": "ConverterAdded is emitted on success", + "params": { + "_tokenConverter": "Address of the token converter" + } + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor" + }, + "findTokenConverters(address,address)": { + "params": { + "_tokenAddressIn": "Address of tokenIn", + "_tokenAddressOut": "Address of tokenOut" + }, + "returns": { + "converters": "Array of the conveters on the basis of the tokens pair", + "convertersBalance": "Array of balances with respect to token out" + } + }, + "findTokenConvertersForConverters(address,address)": { + "params": { + "_tokenAddressIn": "Address of tokenIn", + "_tokenAddressOut": "Address of tokenOut" + }, + "returns": { + "converters": "Array of the conveters on the basis of the tokens pair", + "convertersBalance": "Array of balances with respect to token out" + } + }, + "getAllConverters()": { + "returns": { + "converters": "Array containing all the converters addresses" + } + }, + "initialize(address,uint256)": { + "custom:error": "InvalidMaxLoopsLimit is thrown when when loops limit is invalid", + "custom:event": "ConverterAdded is emitted for each converter added on success", + "params": { + "_accessControlManager": "The address of ACM contract", + "_loopsLimit": "Limit for the loops in the contract to avoid DOS" + } + }, + "isTokenConverter(address)": { + "params": { + "_tokenConverter": "Address of the token converter" + }, + "returns": { + "isConverter": "true if given address is converter otherwise false" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "removeTokenConverter(address)": { + "custom:access": "Only Governance", + "custom:error": "ConverterDoesNotExist is thrown when converter to remove does not exist", + "custom:event": "ConverterRemoved is emitted on success", + "params": { + "_tokenConverter": "Address of the token converter" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setMaxLoopsLimit(uint256)": { + "custom:access": "Only owner", + "custom:error": "InvalidMaxLoopsLimit is thrown when when loops limit is invalid", + "params": { + "limit": "Limit for the max loops can execute at a time" + } + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + } + }, + "title": "ConverterNetwork", + "version": 1 + }, + "userdoc": { + "errors": { + "ConverterAlreadyExists()": [ + { + "notice": "Error thrown when converter already exists" + } + ], + "ConverterDoesNotExist()": [ + { + "notice": "Error thrown converter does not exist" + } + ], + "InvalidMaxLoopsLimit(uint256)": [ + { + "notice": "Error thrown when loops limit is invalid" + } + ], + "InvalidTokenConverterAddress()": [ + { + "notice": "Error thrown when converter address is invalid" + } + ], + "MaxLoopsLimitExceeded(uint256,uint256)": [ + { + "notice": "Thrown an error on maxLoopsLimit exceeds for any loop" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ] + }, + "events": { + "ConverterAdded(address)": { + "notice": "Emitted when new converter is added" + }, + "ConverterRemoved(address)": { + "notice": "Emitted when converter is removed" + }, + "MaxLoopsLimitUpdated(uint256,uint256)": { + "notice": "Emitted when max loops limit is set" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + } + }, + "kind": "user", + "methods": { + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "addTokenConverter(address)": { + "notice": "Adds new converter to the array" + }, + "allConverters(uint256)": { + "notice": "Array holding all the converters" + }, + "findTokenConverters(address,address)": { + "notice": "Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to users for conversion" + }, + "findTokenConvertersForConverters(address,address)": { + "notice": "Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to converters for conversion." + }, + "getAllConverters()": { + "notice": "This function returns the array containing all the converters addresses" + }, + "initialize(address,uint256)": { + "notice": "ConverterNetwork initializer" + }, + "isTokenConverter(address)": { + "notice": "This function checks if the given address is a converter or not" + }, + "removeTokenConverter(address)": { + "notice": "Removes converter from the array" + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "setMaxLoopsLimit(uint256)": { + "notice": "Set the limit for the loops can iterate to avoid the DOS" + } + }, + "notice": "ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 6563, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "maxLoopsLimit", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 6568, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 12108, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "allConverters", + "offset": 0, + "slot": "251", + "type": "t_array(t_contract(IAbstractTokenConverter)12881)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_contract(IAbstractTokenConverter)12881)dyn_storage": { + "base": "t_contract(IAbstractTokenConverter)12881", + "encoding": "dynamic_array", + "label": "contract IAbstractTokenConverter[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAbstractTokenConverter)12881": { + "encoding": "inplace", + "label": "contract IAbstractTokenConverter", + "numberOfBytes": "20" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/arbitrumsepolia/ConverterNetwork_Proxy.json b/deployments/arbitrumsepolia/ConverterNetwork_Proxy.json new file mode 100644 index 00000000..f5bb9df5 --- /dev/null +++ b/deployments/arbitrumsepolia/ConverterNetwork_Proxy.json @@ -0,0 +1,277 @@ +{ + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "receipt": { + "to": null, + "from": "0x638Eb8DFfF094Fd1d52c5A198b44984806C521E5", + "contractAddress": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "transactionIndex": 1, + "gasUsed": "892060", + "logsBloom": "0x00000000000000000000000200000000400000000000000400800800000000040000000000000000000000000000000000000000000000000000000000008000000000000000000000000200000002000001000000000000000000000020000000000000020000000000000000000800080000800000000000000000000000400000000000000000000000000080000000000000000080000000000000800000000000000000000000002000000400000000000000800000000001000000000000000020000000000000000001040000000000000400000000000000000020000000000200000000000000000000000000000800000000000000000000000000", + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120", + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000a5fd972d51ac9a74bb02e9072ce8b3ec33bfb832" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000638eb8dfff094fd1d52c5a198b44984806c521e5" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f", + "logIndex": 2, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 3, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + }, + { + "transactionIndex": 1, + "blockNumber": 94298904, + "transactionHash": "0xc7bf376e7daa17038614e06abba655c30171fcf1beac92b27337a04ef998eff9", + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a78a1df376c3ceebc5fab574fe6eddbbf76fd03e", + "logIndex": 5, + "blockHash": "0x68357a364887ce81169a61dc91fcc9d5ab93810b7b105b2de8ece0d98f8f2120" + } + ], + "blockNumber": 94298904, + "cumulativeGasUsed": "892060", + "status": 1, + "byzantium": true + }, + "args": [ + "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", + "0xcd6dc687000000000000000000000000a36ad96441cb931d8dfeaaac97d3fab4b39e590f0000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} From 21075008d181a7d1d3934fd9f4d123a99067658c Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Mon, 4 Nov 2024 13:01:00 +0000 Subject: [PATCH 05/24] feat: updating deployment files --- deployments/arbitrumsepolia.json | 5009 ++++++++++++++++---- deployments/arbitrumsepolia_addresses.json | 10 + 2 files changed, 4040 insertions(+), 979 deletions(-) diff --git a/deployments/arbitrumsepolia.json b/deployments/arbitrumsepolia.json index b8a2dd95..830b0114 100644 --- a/deployments/arbitrumsepolia.json +++ b/deployments/arbitrumsepolia.json @@ -2,173 +2,8 @@ "name": "arbitrumsepolia", "chainId": "421614", "contracts": { - "DefaultProxyAdmin": { - "address": "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "initialOwner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ] - }, - "ProtocolShareReserve": { - "address": "0x09267d30798B59c581ce54E861A084C6FC298666", + "ConverterNetwork": { + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", "abi": [ { "anonymous": false, @@ -295,12 +130,28 @@ }, { "inputs": [], - "name": "InvalidAddress", + "name": "ConverterAlreadyExists", "type": "error" }, { "inputs": [], - "name": "InvalidTotalPercentage", + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + } + ], + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", "type": "error" }, { @@ -351,72 +202,75 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "converter", "type": "address" - }, + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": true, "internalType": "address", - "name": "asset", + "name": "converter", "type": "address" - }, + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", + "internalType": "uint8", + "name": "version", "type": "uint8" - }, + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": false, "internalType": "uint256", - "name": "percent", + "name": "oldMaxLoopsLimit", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "amount", + "name": "newmaxLoopsLimit", "type": "uint256" } ], - "name": "AssetReleased", + "name": "MaxLoopsLimitUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "comptroller", + "name": "oldAccessControlManager", "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "asset", + "name": "newAccessControlManager", "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "AssetsReservesUpdated", + "name": "NewAccessControlManager", "type": "event" }, { @@ -425,23 +279,17 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "previousOwner", "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "name": "DistributionConfigAdded", + "name": "OwnershipTransferStarted", "type": "event" }, { @@ -450,222 +298,187 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "previousOwner", "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "name": "DistributionConfigRemoved", + "name": "OwnershipTransferred", "type": "event" }, { - "anonymous": false, - "inputs": [ + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "destination", + "internalType": "contract IAccessControlManagerV8", + "name": "", "type": "address" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "oldPercentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "newPercentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "DistributionConfigUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" } ], - "name": "Initialized", - "type": "event" + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "oldMaxLoopsLimit", + "name": "", "type": "uint256" - }, + } + ], + "name": "allConverters", + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "newmaxLoopsLimit", - "type": "uint256" + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" } ], - "name": "MaxLoopsLimitUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, "internalType": "address", - "name": "oldAccessControlManager", + "name": "_tokenAddressIn", "type": "address" }, { - "indexed": false, "internalType": "address", - "name": "newAccessControlManager", + "name": "_tokenAddressOut", "type": "address" } ], - "name": "NewAccessControlManager", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "findTokenConverters", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" + "internalType": "address[]", + "name": "converters", + "type": "address[]" }, { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" } ], - "name": "OwnershipTransferStarted", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "_tokenAddressIn", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "_tokenAddressOut", "type": "address" } ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "findTokenConvertersForConverters", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "oldPoolRegistry", - "type": "address" + "internalType": "address[]", + "name": "converters", + "type": "address[]" }, { - "indexed": true, - "internalType": "address", - "name": "newPoolRegistry", - "type": "address" + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" } ], - "name": "PoolRegistryUpdated", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "inputs": [], + "name": "getAllConverters", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "comptroller", - "type": "address" - }, + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - "indexed": true, "internalType": "address", - "name": "asset", + "name": "_accessControlManager", "type": "address" }, { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "oldBalance", - "type": "uint256" - }, - { - "indexed": false, "internalType": "uint256", - "name": "newBalance", + "name": "_loopsLimit", "type": "uint256" } ], - "name": "ReservesUpdated", - "type": "event" + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - "inputs": [], - "name": "CORE_POOL_COMPTROLLER", - "outputs": [ + "inputs": [ { "internalType": "address", - "name": "", + "name": "_tokenConverter", "type": "address" } ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "MAX_PERCENT", + "name": "maxLoopsLimit", "outputs": [ { - "internalType": "uint16", + "internalType": "uint256", "name": "", - "type": "uint16" + "type": "uint256" } ], "stateMutability": "view", @@ -673,7 +486,7 @@ }, { "inputs": [], - "name": "WBNB", + "name": "owner", "outputs": [ { "internalType": "address", @@ -686,17 +499,10 @@ }, { "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "accessControlManager", + "name": "pendingOwner", "outputs": [ { - "internalType": "contract IAccessControlManagerV8", + "internalType": "address", "name": "", "type": "address" } @@ -707,29 +513,19 @@ { "inputs": [ { - "components": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct ProtocolShareReserve.DistributionConfig[]", - "name": "configs", - "type": "tuple[]" + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" } ], - "name": "addOrUpdateDistributionConfigs", + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -738,113 +534,270 @@ "inputs": [ { "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", + "name": "accessControlManager_", "type": "address" - }, - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "", - "type": "uint8" } ], - "name": "assetsReserves", - "outputs": [ + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "limit", "type": "uint256" } ], - "stateMutability": "view", + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "ConverterNetwork_Implementation": { + "address": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConverterAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "ConverterDoesNotExist", + "type": "error" + }, { "inputs": [ { "internalType": "uint256", - "name": "", + "name": "loopsLimit", "type": "uint256" } ], - "name": "distributionTargets", - "outputs": [ + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", + "type": "error" + }, + { + "inputs": [ { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" }, { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" }, { "internalType": "address", - "name": "destination", + "name": "calledContract", "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" } ], - "stateMutability": "view", - "type": "function" + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "destination", + "name": "converter", "type": "address" - }, + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", "type": "uint8" } ], - "name": "getPercentageDistribution", - "outputs": [ + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "newmaxLoopsLimit", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" + "name": "MaxLoopsLimitUpdated", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "address", - "name": "comptroller", + "name": "oldAccessControlManager", "type": "address" }, { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { + "indexed": true, "internalType": "address", - "name": "destination", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", "type": "address" }, { + "indexed": true, "internalType": "address", - "name": "asset", + "name": "newOwner", "type": "address" } ], - "name": "getUnreleasedFunds", + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", "outputs": [ { - "internalType": "uint256", + "internalType": "contract IAccessControlManagerV8", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -853,155 +806,3217 @@ { "inputs": [ { - "internalType": "address", - "name": "_accessControlManager", + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", "type": "address" - }, - { - "internalType": "uint256", - "name": "_loopsLimit", - "type": "uint256" } ], - "name": "initialize", + "name": "addTokenConverter", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "maxLoopsLimit", - "outputs": [ + "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], + "name": "allConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, { - "inputs": [], - "name": "owner", - "outputs": [ + "inputs": [ { "internalType": "address", - "name": "", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConvertersForConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, + "ConverterNetwork_Proxy": { + "address": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "DefaultProxyAdmin": { + "address": "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] + }, + "ProtocolShareReserve": { + "address": "0x09267d30798B59c581ce54E861A084C6FC298666", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "ProtocolShareReserve_Implementation": { + "address": "0xF5B07c27d213A2B838A3D155FFEC0d52B17E91fd", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_corePoolComptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "_wbnb", + "type": "address" + }, + { + "internalType": "address", + "name": "_vbnb", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, + "ProtocolShareReserve_Proxy": { + "address": "0x09267d30798B59c581ce54E861A084C6FC298666", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "SingleTokenConverterBeacon": { + "address": "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, + "SingleTokenConverterImp": { + "address": "0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + } + ], + "name": "AmountInHigherThanMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountInMismatched", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + } + ], + "name": "AmountOutLowerThanMinRequired", + "type": "error" + }, + { + "inputs": [], + "name": "AmountOutMismatched", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionConfigNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionEnabledOnlyForPrivateConversions", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensActive", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensPaused", + "type": "error" + }, + { + "inputs": [], + "name": "DeflationaryTokenNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxIncentive", + "type": "uint256" + } + ], + "name": "IncentiveTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMisMatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", + "type": "error" + }, + { + "inputs": [], + "name": "NonZeroIncentiveForPrivateConversion", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetTransferredToDestination", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldBaseAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newBaseAsset", + "type": "address" + } + ], + "name": "BaseAssetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" + } + ], + "name": "ConversionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "converterNetwork", + "type": "address" + } + ], + "name": "ConverterNetworkAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", + "type": "address" + } + ], + "name": "DestinationAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinAmountToConvert", + "type": "uint256" + } + ], + "name": "MinAmountToConvertUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "NewAccessControlManager", + "type": "event" }, { - "inputs": [], - "name": "pendingOwner", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "OwnershipTransferStarted", + "type": "event" }, { - "inputs": [], - "name": "poolRegistry", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "OwnershipTransferred", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "comptroller", + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", "type": "address" }, { - "internalType": "address[]", - "name": "assets", - "type": "address[]" + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", + "type": "address" } ], - "name": "releaseFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "PriceOracleUpdated", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" }, { + "indexed": true, "internalType": "address", - "name": "destination", + "name": "to", "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" } ], - "name": "removeDistributionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "SweepToken", + "type": "event" }, { "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + "name": "MAX_INCENTIVE", + "outputs": [ { - "internalType": "address", - "name": "accessControlManager_", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "setAccessControlManager", + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "accessControlManager", + "outputs": [ { - "internalType": "address", - "name": "_poolRegistry", + "internalType": "contract IAccessControlManagerV8", + "name": "", "type": "address" } ], - "name": "setPoolRegistry", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "", + "name": "tokenAddress", "type": "address" } ], - "name": "totalAssetReserve", + "name": "balanceOf", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "tokenBalance", "type": "uint256" } ], @@ -1010,61 +4025,54 @@ }, { "inputs": [], - "name": "totalDistributions", + "name": "baseAsset", "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ { "internalType": "address", - "name": "newOwner", + "name": "", "type": "address" } ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "comptroller", + "name": "", "type": "address" }, { "internalType": "address", - "name": "asset", + "name": "", "type": "address" + } + ], + "name": "conversionConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" }, { - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", "type": "uint8" } ], - "name": "updateAssetsState", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "vBNB", + "name": "conversionPaused", "outputs": [ { - "internalType": "address", + "internalType": "bool", "name": "", - "type": "address" + "type": "bool" } ], "stateMutability": "view", @@ -1073,405 +4081,390 @@ { "inputs": [ { - "internalType": "address", - "name": "_logic", - "type": "address" + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" }, { - "internalType": "address", - "name": "admin_", - "type": "address" + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - } - ] - }, - "ProtocolShareReserve_Implementation": { - "address": "0xF5B07c27d213A2B838A3D155FFEC0d52B17E91fd", - "abi": [ - { - "inputs": [ { "internalType": "address", - "name": "_corePoolComptroller", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "_wbnb", + "name": "tokenAddressOut", "type": "address" }, { "internalType": "address", - "name": "_vbnb", + "name": "to", "type": "address" } ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "InvalidAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidTotalPercentage", - "type": "error" - }, - { - "inputs": [ + "name": "convertExactTokens", + "outputs": [ { "internalType": "uint256", - "name": "loopsLimit", + "name": "actualAmountIn", "type": "uint256" }, { "internalType": "uint256", - "name": "requiredLoops", + "name": "actualAmountOut", "type": "uint256" } ], - "name": "MaxLoopsLimitExceeded", - "type": "error" + "stateMutability": "nonpayable", + "type": "function" }, { "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, { "internalType": "address", - "name": "sender", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "calledContract", + "name": "tokenAddressOut", "type": "address" }, { - "internalType": "string", - "name": "methodSignature", - "type": "string" + "internalType": "address", + "name": "to", + "type": "address" } ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" + "name": "convertExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { "internalType": "address", - "name": "destination", + "name": "tokenAddressIn", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "asset", + "name": "tokenAddressOut", "type": "address" }, { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokens", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "percent", + "name": "actualAmountIn", "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "amount", + "name": "actualAmountOut", "type": "uint256" } ], - "name": "AssetReleased", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { "internalType": "address", - "name": "comptroller", + "name": "tokenAddressIn", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "asset", + "name": "tokenAddressOut", "type": "address" }, { - "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { "internalType": "uint256", - "name": "amount", + "name": "actualAmountIn", "type": "uint256" }, { - "indexed": false, - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" } ], - "name": "AssetsReservesUpdated", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "inputs": [], + "name": "converterNetwork", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "destination", + "internalType": "contract IConverterNetwork", + "name": "", "type": "address" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "DistributionConfigAdded", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "inputs": [], + "name": "destinationAddress", + "outputs": [ { - "indexed": true, "internalType": "address", - "name": "destination", + "name": "", "type": "address" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "DistributionConfigRemoved", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { "internalType": "address", - "name": "destination", + "name": "tokenAddressIn", "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "oldPercentage", - "type": "uint16" - }, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ { - "indexed": false, - "internalType": "uint16", - "name": "newPercentage", - "type": "uint16" + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" }, { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" } ], - "name": "DistributionConfigUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" } ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "getAmountOut", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "oldMaxLoopsLimit", + "name": "amountConvertedMantissa", "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "newmaxLoopsLimit", + "name": "amountOutMantissa", "type": "uint256" } ], - "name": "MaxLoopsLimitUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { "internalType": "address", - "name": "oldAccessControlManager", + "name": "tokenAddressIn", "type": "address" }, { - "indexed": false, "internalType": "address", - "name": "newAccessControlManager", + "name": "tokenAddressOut", "type": "address" } ], - "name": "NewAccessControlManager", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "getUpdatedAmountIn", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" } ], - "name": "OwnershipTransferStarted", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { "internalType": "address", - "name": "previousOwner", + "name": "tokenAddressIn", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "tokenAddressOut", "type": "address" } ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "getUpdatedAmountOut", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "oldPoolRegistry", - "type": "address" + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "newPoolRegistry", - "type": "address" + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" } ], - "name": "PoolRegistryUpdated", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, "internalType": "address", - "name": "comptroller", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "asset", + "name": "destinationAddress_", "type": "address" }, { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "address", + "name": "baseAsset_", + "type": "address" }, { - "indexed": false, "internalType": "uint256", - "name": "oldBalance", + "name": "minAmountToConvert_", "type": "uint256" - }, + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "newBalance", + "name": "", "type": "uint256" } ], - "name": "ReservesUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { "inputs": [], - "name": "CORE_POOL_COMPTROLLER", + "name": "owner", "outputs": [ { "internalType": "address", @@ -1484,12 +4477,19 @@ }, { "inputs": [], - "name": "MAX_PERCENT", + "name": "pauseConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", "outputs": [ { - "internalType": "uint16", + "internalType": "address", "name": "", - "type": "uint16" + "type": "address" } ], "stateMutability": "view", @@ -1497,10 +4497,10 @@ }, { "inputs": [], - "name": "WBNB", + "name": "priceOracle", "outputs": [ { - "internalType": "address", + "internalType": "contract ResilientOracle", "name": "", "type": "address" } @@ -1510,50 +4510,40 @@ }, { "inputs": [], - "name": "acceptOwnership", + "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "accessControlManager", - "outputs": [ + "name": "resumeConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { - "internalType": "contract IAccessControlManagerV8", - "name": "", + "internalType": "address", + "name": "accessControlManager_", "type": "address" } ], - "stateMutability": "view", + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { - "components": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct ProtocolShareReserve.DistributionConfig[]", - "name": "configs", - "type": "tuple[]" + "internalType": "address", + "name": "baseAsset_", + "type": "address" } ], - "name": "addOrUpdateDistributionConfigs", + "name": "setBaseAsset", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1562,358 +4552,415 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "", + "name": "tokenAddressOut", "type": "address" }, { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "", - "type": "uint8" - } - ], - "name": "assetsReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" } ], - "stateMutability": "view", + "name": "setConversionConfig", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "distributionTargets", - "outputs": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" }, { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" }, { - "internalType": "address", - "name": "destination", + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" + } + ], + "name": "setConversionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", "type": "address" } ], - "stateMutability": "view", + "name": "setConverterNetwork", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "destination", + "name": "destinationAddress_", "type": "address" - }, - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "getPercentageDistribution", - "outputs": [ + "name": "setDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "minAmountToConvert_", "type": "uint256" } ], - "stateMutability": "view", + "name": "setMinAmountToConvert", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { - "internalType": "address", - "name": "comptroller", + "internalType": "contract ResilientOracle", + "name": "priceOracle_", "type": "address" - }, - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", - "name": "destination", + "name": "tokenAddress", "type": "address" }, { "internalType": "address", - "name": "asset", + "name": "to", "type": "address" - } - ], - "name": "getUnreleasedFunds", - "outputs": [ + }, { "internalType": "uint256", - "name": "", + "name": "amount", "type": "uint256" } ], - "stateMutability": "view", + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "_accessControlManager", + "name": "newOwner", "type": "address" - }, - { - "internalType": "uint256", - "name": "_loopsLimit", - "type": "uint256" } ], - "name": "initialize", + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "maxLoopsLimit", - "outputs": [ + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" } ], - "stateMutability": "view", + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" + } + ] + }, + "USDCPrimeConverter": { + "address": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" }, { - "inputs": [], - "name": "owner", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "address", - "name": "", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "AdminChanged", + "type": "event" }, { - "inputs": [], - "name": "pendingOwner", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "beacon", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "BeaconUpgraded", + "type": "event" }, { - "inputs": [], - "name": "poolRegistry", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "implementation", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "USDTPrimeConverter": { + "address": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "abi": [ { "inputs": [ { "internalType": "address", - "name": "comptroller", + "name": "beacon", "type": "address" }, { - "internalType": "address[]", - "name": "assets", - "type": "address[]" + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], - "name": "releaseFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable", + "type": "constructor" }, { + "anonymous": false, "inputs": [ { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" }, { + "indexed": false, "internalType": "address", - "name": "destination", + "name": "newAdmin", "type": "address" } ], - "name": "removeDistributionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "AdminChanged", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "accessControlManager_", + "name": "beacon", "type": "address" } ], - "name": "setAccessControlManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "BeaconUpgraded", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "_poolRegistry", + "name": "implementation", "type": "address" } ], - "name": "setPoolRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "WBTCPrimeConverter": { + "address": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "abi": [ { "inputs": [ { "internalType": "address", - "name": "", + "name": "beacon", "type": "address" - } - ], - "name": "totalAssetReserve", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalDistributions", - "outputs": [ + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], - "stateMutability": "view", - "type": "function" + "stateMutability": "payable", + "type": "constructor" }, { + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "address", - "name": "newOwner", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", "type": "address" } ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "AdminChanged", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "address", - "name": "asset", + "name": "beacon", "type": "address" - }, - { - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" } ], - "name": "updateAssetsState", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "BeaconUpgraded", + "type": "event" }, { - "inputs": [], - "name": "vBNB", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "implementation", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" } ] }, - "ProtocolShareReserve_Proxy": { - "address": "0x09267d30798B59c581ce54E861A084C6FC298666", + "WETHPrimeConverter": { + "address": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", "abi": [ { "inputs": [ { "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", + "name": "beacon", "type": "address" }, { "internalType": "bytes", - "name": "_data", + "name": "data", "type": "bytes" } ], @@ -1970,74 +5017,78 @@ "type": "fallback" }, { - "inputs": [], - "name": "admin", - "outputs": [ + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "XVSVaultConverter": { + "address": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", + "abi": [ + { + "inputs": [ { "internalType": "address", - "name": "admin_", + "name": "beacon", "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" } ], - "stateMutability": "nonpayable", - "type": "function" + "stateMutability": "payable", + "type": "constructor" }, { + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "address", - "name": "newAdmin", + "name": "previousAdmin", "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ + }, { + "indexed": false, "internalType": "address", - "name": "implementation_", + "name": "newAdmin", "type": "address" } ], - "stateMutability": "nonpayable", - "type": "function" + "name": "AdminChanged", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "newImplementation", + "name": "beacon", "type": "address" } ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "BeaconUpgraded", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "newImplementation", + "name": "implementation", "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" } ], - "name": "upgradeToAndCall", - "outputs": [], + "name": "Upgraded", + "type": "event" + }, + { "stateMutability": "payable", - "type": "function" + "type": "fallback" }, { "stateMutability": "payable", diff --git a/deployments/arbitrumsepolia_addresses.json b/deployments/arbitrumsepolia_addresses.json index 037e7a9d..5ebff03b 100644 --- a/deployments/arbitrumsepolia_addresses.json +++ b/deployments/arbitrumsepolia_addresses.json @@ -2,10 +2,20 @@ "name": "arbitrumsepolia", "chainId": "421614", "addresses": { + "ConverterNetwork": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", + "ConverterNetwork_Implementation": "0xa5FD972D51aC9a74Bb02E9072CE8b3eC33BfB832", + "ConverterNetwork_Proxy": "0x9dD63dC8DADf90B67511939C00607484567B0D7A", "DefaultProxyAdmin": "0xA78A1Df376c3CEeBC5Fab574fe6EdDbbF76fd03e", "ProtocolShareReserve": "0x09267d30798B59c581ce54E861A084C6FC298666", "ProtocolShareReserve_Implementation": "0xF5B07c27d213A2B838A3D155FFEC0d52B17E91fd", "ProtocolShareReserve_Proxy": "0x09267d30798B59c581ce54E861A084C6FC298666", + "SingleTokenConverterBeacon": "0xC77D0F75f1e4e3720DA1D2F5D809F439125a2Fd4", + "SingleTokenConverterImp": "0x4ea44b72e00e942b259a6a3720Cf1B8776b9fe93", + "USDCPrimeConverter": "0xE88ed530597bc8D50e8CfC0EecAAFf6A93248C74", + "USDTPrimeConverter": "0xFC0ec257d3ec4D673cB4e2CD3827C202e75fd0be", + "WBTCPrimeConverter": "0x3089F46caf6611806caA39Ffaf672097156b893a", + "WETHPrimeConverter": "0x0d1e90c1F86CD1c1dF514B493c5985B3FD9CD6C8", + "XVSVaultConverter": "0x99942a033454Cef6Ffb2843886C8b2E658E7D5fd", "XVSVaultTreasury": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6", "XVSVaultTreasury_Implementation": "0xe0481f604D9B127F3Bb93FA73cF3e48A9e47b82a", "XVSVaultTreasury_Proxy": "0x309b71a417dA9CfA8aC47e6038000B1739d9A3A6" From 1ce0e0348b46faa7cce571d6e62ad128a6aaf2d0 Mon Sep 17 00:00:00 2001 From: web3rover Date: Thu, 14 Nov 2024 12:53:47 +0400 Subject: [PATCH 06/24] fix: added config --- .env.example | 1 + .github/workflows/ci.yml | 2 +- deploy/001-psr.ts | 2 +- hardhat.config.ts | 18 ++++++++++++++ helpers/utils.ts | 1 + yarn.lock | 54 ++++++++++++++-------------------------- 6 files changed, 40 insertions(+), 38 deletions(-) diff --git a/.env.example b/.env.example index 7776c0b9..b9857022 100644 --- a/.env.example +++ b/.env.example @@ -20,6 +20,7 @@ DEPLOYER_PRIVATE_KEY= #ARCHIVE_NODE_zksyncmainnet=https://open-platform.nodereal.io//zksync #ARCHIVE_NODE_opsepolia=https://sepolia.optimism.io #ARCHIVE_NODE_opmainnet=https://opt-mainnet.nodereal.io/v1/ +#ARCHIVE_NODE_basesepolia=https://base-sepolia.blastapi.io/ ETHERSCAN_API_KEY= REPORT_GAS= \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e54cbbc3..a74f83a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: - name: Export deployments run: | - for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet arbitrumsepolia arbitrumone opsepolia opmainnet; do + for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia; do EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json done diff --git a/deploy/001-psr.ts b/deploy/001-psr.ts index 49a6fbfe..ffc77ed7 100644 --- a/deploy/001-psr.ts +++ b/deploy/001-psr.ts @@ -16,7 +16,7 @@ const func: DeployFunction = async ({ const comptrollerAddress = (await ethers.getContractOrNull("Unitroller"))?.address || ADDRESS_ONE; const WBNBAddress = (await ethers.getContractOrNull("WBNB"))?.address || ADDRESS_ONE; const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; + const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || "0x724138223D8F76b519fdE715f60124E7Ce51e051"; const loopsLimit = 20; const defaultProxyAdmin = await hre.artifacts.readArtifact( diff --git a/hardhat.config.ts b/hardhat.config.ts index 65197e9a..8c4e22e7 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -187,6 +187,15 @@ const config: HardhatUserConfig = { live: true, accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], }, + basesepolia: { + url: process.env.ARCHIVE_NODE_basesepolia || "https://sepolia.base.org", + chainId: 84532, + live: true, + // accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], + accounts: { + mnemonic: process.env.MNEMONIC || "", + } + }, }, etherscan: { apiKey: { @@ -200,6 +209,7 @@ const config: HardhatUserConfig = { arbitrumone: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", opsepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", opmainnet: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", + basesepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY" }, customChains: [ { @@ -282,6 +292,14 @@ const config: HardhatUserConfig = { browserURL: "https://optimistic.etherscan.io/", }, }, + { + network: "basesepolia", + chainId: 84532, + urls: { + apiURL: "https://api-sepolia.basescan.org/api", + browserURL: "https://sepolia.basescan.org/", + }, + }, ], }, paths: { diff --git a/helpers/utils.ts b/helpers/utils.ts index 40f07c80..8d927efa 100644 --- a/helpers/utils.ts +++ b/helpers/utils.ts @@ -36,4 +36,5 @@ export const multisigs: ChainAddressesConfig = { zksyncmainnet: "0x751Aa759cfBB6CE71A43b48e40e1cCcFC66Ba4aa", opsepolia: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", opmainnet: "0x2e94dd14E81999CdBF5deDE31938beD7308354b3", + basesepolia: "0xdf3b635d2b535f906BB02abb22AED71346E36a00", }; diff --git a/yarn.lock b/yarn.lock index e87e6430..127922e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3544,42 +3544,7 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/protocol-reserve@npm:^1.1.0": - version: 1.5.0 - resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^1.3.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 - languageName: node - linkType: hard - -"@venusprotocol/protocol-reserve@npm:^2.0.0": - version: 2.3.0 - resolution: "@venusprotocol/protocol-reserve@npm:2.3.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^2.0.3 - "@venusprotocol/venus-protocol": ^9.1.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: b9e12702281d0790c0136f922400b5f90ff88d04d2af97580620a2677190c1957a4fdb38ff6600ff5e4f71e4d521c8bb013d7775814a2f68e3883544f38caa95 - languageName: node - linkType: hard - -"@venusprotocol/protocol-reserve@workspace:.": +"@venusprotocol/protocol-reserve@^2.0.0, @venusprotocol/protocol-reserve@workspace:.": version: 0.0.0-use.local resolution: "@venusprotocol/protocol-reserve@workspace:." dependencies: @@ -3647,6 +3612,23 @@ __metadata: languageName: unknown linkType: soft +"@venusprotocol/protocol-reserve@npm:^1.1.0": + version: 1.5.0 + resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" + dependencies: + "@nomiclabs/hardhat-ethers": ^2.2.3 + "@openzeppelin/contracts": ^4.8.3 + "@openzeppelin/contracts-upgradeable": ^4.8.3 + "@openzeppelin/hardhat-upgrades": ^1.21.0 + "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/solidity-utilities": ^1.3.0 + ethers: ^5.7.0 + hardhat-deploy: ^0.11.14 + module-alias: ^2.2.2 + checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 + languageName: node + linkType: hard + "@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0": version: 2.0.0 resolution: "@venusprotocol/solidity-utilities@npm:2.0.0" From f16af2929254311f00c06adb80c7d39cda48fe0b Mon Sep 17 00:00:00 2001 From: web3rover Date: Thu, 14 Nov 2024 14:16:12 +0400 Subject: [PATCH 07/24] fix: deployed contracts --- deploy/001-psr.ts | 2 +- deployments/basesepolia/.chainId | 1 + .../basesepolia/DefaultProxyAdmin.json | 200 +++ .../basesepolia/ProtocolShareReserve.json | 1054 ++++++++++++++ .../ProtocolShareReserve_Implementation.json | 1285 +++++++++++++++++ .../ProtocolShareReserve_Proxy.json | 272 ++++ .../027aeec938943227f90cf24126ba2c44.json | 280 ++++ hardhat.config.ts | 7 +- 8 files changed, 3095 insertions(+), 6 deletions(-) create mode 100644 deployments/basesepolia/.chainId create mode 100644 deployments/basesepolia/DefaultProxyAdmin.json create mode 100644 deployments/basesepolia/ProtocolShareReserve.json create mode 100644 deployments/basesepolia/ProtocolShareReserve_Implementation.json create mode 100644 deployments/basesepolia/ProtocolShareReserve_Proxy.json create mode 100644 deployments/basesepolia/solcInputs/027aeec938943227f90cf24126ba2c44.json diff --git a/deploy/001-psr.ts b/deploy/001-psr.ts index ffc77ed7..49a6fbfe 100644 --- a/deploy/001-psr.ts +++ b/deploy/001-psr.ts @@ -16,7 +16,7 @@ const func: DeployFunction = async ({ const comptrollerAddress = (await ethers.getContractOrNull("Unitroller"))?.address || ADDRESS_ONE; const WBNBAddress = (await ethers.getContractOrNull("WBNB"))?.address || ADDRESS_ONE; const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || "0x724138223D8F76b519fdE715f60124E7Ce51e051"; + const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; const loopsLimit = 20; const defaultProxyAdmin = await hre.artifacts.readArtifact( diff --git a/deployments/basesepolia/.chainId b/deployments/basesepolia/.chainId new file mode 100644 index 00000000..663c0116 --- /dev/null +++ b/deployments/basesepolia/.chainId @@ -0,0 +1 @@ +84532 diff --git a/deployments/basesepolia/DefaultProxyAdmin.json b/deployments/basesepolia/DefaultProxyAdmin.json new file mode 100644 index 00000000..4869399d --- /dev/null +++ b/deployments/basesepolia/DefaultProxyAdmin.json @@ -0,0 +1,200 @@ +{ + "address": "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x4a35abfec6aedd3e6ff6fc55897852a6db40a8f1383bf0d242a8508241aba171", + "receipt": { + "to": null, + "from": "0x646413D07084c4C9B07C023a2207ad0b5292094d", + "contractAddress": "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "transactionIndex": 101, + "gasUsed": "473302", + "logsBloom": "0x00000000000000000000000000000000000000000000000000804000000000000000000000000000000000000000000000000002000000000000000000000000008080000000000000000000000000000001000000000000000000000000000000000000020000000000000000000804000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xe50752f4169d88b51e26ee724b18cb3bc73137c7ac55f63a0980d2c9f9f78b9e", + "transactionHash": "0x4a35abfec6aedd3e6ff6fc55897852a6db40a8f1383bf0d242a8508241aba171", + "logs": [ + { + "transactionIndex": 101, + "blockNumber": 17650044, + "transactionHash": "0x4a35abfec6aedd3e6ff6fc55897852a6db40a8f1383bf0d242a8508241aba171", + "address": "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000df3b635d2b535f906bb02abb22aed71346e36a00" + ], + "data": "0x", + "logIndex": 268, + "blockHash": "0xe50752f4169d88b51e26ee724b18cb3bc73137c7ac55f63a0980d2c9f9f78b9e" + } + ], + "blockNumber": 17650044, + "cumulativeGasUsed": "19469156", + "status": 1, + "byzantium": true + }, + "args": ["0xdf3b635d2b535f906BB02abb22AED71346E36a00"], + "numDeployments": 1, + "bytecode": "0x6080604052348015600f57600080fd5b506040516107e43803806107e4833981016040819052602c91608a565b80603481603a565b505060b8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215609b57600080fd5b81516001600160a01b038116811460b157600080fd5b9392505050565b61071d806100c76000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104ed565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610511565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f366004610560565b6102de565b34801561013057600080fd5b506100d161013f366004610511565b61036f565b34801561015057600080fd5b506100d161015f3660046104ed565b6103c7565b34801561017057600080fd5b506100a061017f3660046104ed565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610636565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610653565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610653565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610653565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610688565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610653565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610653565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461045f57600080fd5b6000602082840312156104ff57600080fd5b813561050a816104d8565b9392505050565b6000806040838503121561052457600080fd5b823561052f816104d8565b9150602083013561053f816104d8565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561057557600080fd5b8335610580816104d8565b92506020840135610590816104d8565b9150604084013567ffffffffffffffff808211156105ad57600080fd5b818601915086601f8301126105c157600080fd5b8135818111156105d3576105d361054a565b604051601f8201601f19908116603f011681019083821181831017156105fb576105fb61054a565b8160405282815289602084870101111561061457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561064857600080fd5b815161050a816104d8565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b03831681526000602060406020840152835180604085015260005b818110156106c5578581018301518582016060015282016106a9565b506000606082860101526060601f19601f83011685010192505050939250505056fea264697066735822122030f52ef7e16587f148a9f5ca0dbcadc434f9288a9162f8ab87307aa33db8fc4364736f6c63430008190033", + "deployedBytecode": "0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104ed565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610511565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f366004610560565b6102de565b34801561013057600080fd5b506100d161013f366004610511565b61036f565b34801561015057600080fd5b506100d161015f3660046104ed565b6103c7565b34801561017057600080fd5b506100a061017f3660046104ed565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610636565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610653565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610653565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610653565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610688565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610653565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610653565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461045f57600080fd5b6000602082840312156104ff57600080fd5b813561050a816104d8565b9392505050565b6000806040838503121561052457600080fd5b823561052f816104d8565b9150602083013561053f816104d8565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561057557600080fd5b8335610580816104d8565b92506020840135610590816104d8565b9150604084013567ffffffffffffffff808211156105ad57600080fd5b818601915086601f8301126105c157600080fd5b8135818111156105d3576105d361054a565b604051601f8201601f19908116603f011681019083821181831017156105fb576105fb61054a565b8160405282815289602084870101111561061457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561064857600080fd5b815161050a816104d8565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b03831681526000602060406020840152835180604085015260005b818110156106c5578581018301518582016060015282016106a9565b506000606082860101526060601f19601f83011685010192505050939250505056fea264697066735822122030f52ef7e16587f148a9f5ca0dbcadc434f9288a9162f8ab87307aa33db8fc4364736f6c63430008190033" +} diff --git a/deployments/basesepolia/ProtocolShareReserve.json b/deployments/basesepolia/ProtocolShareReserve.json new file mode 100644 index 00000000..394ff057 --- /dev/null +++ b/deployments/basesepolia/ProtocolShareReserve.json @@ -0,0 +1,1054 @@ +{ + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "receipt": { + "to": null, + "from": "0x646413D07084c4C9B07C023a2207ad0b5292094d", + "contractAddress": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "transactionIndex": 6, + "gasUsed": "734344", + "logsBloom": "0x00000000000000000000020000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000001002000001000000000000800000000000000000000000020000000001000000000800000000800000000020040000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000002000000400000000000000800000000080000000000000000020000000000000000001040000000000000400000000010000000020000020000200000000000000000000000000000800000000000000000000000000", + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f", + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "logs": [ + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000de1fc9e003c2637e94da29d55783ce42f1e1f81c" + ], + "data": "0x", + "logIndex": 11, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000646413d07084c4c9b07c023a2207ad0b5292094d" + ], + "data": "0x", + "logIndex": 12, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000724138223d8f76b519fde715f60124e7ce51e051", + "logIndex": 13, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 14, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 15, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b85dd19112c4bf1240fed0f26e8d0b0576a82546", + "logIndex": 16, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + } + ], + "blockNumber": 17905507, + "cumulativeGasUsed": "4937924", + "status": 1, + "byzantium": true + }, + "args": [ + "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "0xcd6dc687000000000000000000000000724138223d8f76b519fde715f60124e7ce51e0510000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol\":\"OptimizedTransparentUpgradeableProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"hardhat-deploy/solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\\n address internal immutable _ADMIN;\\n\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _ADMIN = admin_;\\n\\n // still store it to work with EIP-1967\\n bytes32 slot = _ADMIN_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, admin_)\\n }\\n emit AdminChanged(address(0), admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n\\n function _getAdmin() internal view virtual override returns (address) {\\n return _ADMIN;\\n }\\n}\\n\",\"keccak256\":\"0xa30117644e27fa5b49e162aae2f62b36c1aca02f801b8c594d46e2024963a534\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052604051610ea3380380610ea3833981016040819052610022916103d2565b828161004f60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6104a2565b600080516020610e5c8339815191521461006b5761006b6104c3565b61007782826000610128565b506100a5905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61046104a2565b600080516020610e3c833981519152146100c1576100c16104c3565b6001600160a01b0382166080819052600080516020610e3c8339815191528381556040805160008152602081019390935290917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a150505050610528565b61013183610154565b60008251118061013e5750805b1561014f5761014d8383610194565b505b505050565b61015d816101c2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101b98383604051806060016040528060278152602001610e7c60279139610263565b90505b92915050565b6001600160a01b0381163b6102345760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b600080516020610e5c83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60606001600160a01b0384163b6102cb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161022b565b600080856001600160a01b0316856040516102e691906104d9565b600060405180830381855af49150503d8060008114610321576040519150601f19603f3d011682016040523d82523d6000602084013e610326565b606091505b509092509050610337828286610343565b925050505b9392505050565b6060831561035257508161033c565b8251156103625782518084602001fd5b8160405162461bcd60e51b815260040161022b91906104f5565b80516001600160a01b038116811461039357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103c95781810151838201526020016103b1565b50506000910152565b6000806000606084860312156103e757600080fd5b6103f08461037c565b92506103fe6020850161037c565b60408501519092506001600160401b038082111561041b57600080fd5b818601915086601f83011261042f57600080fd5b81518181111561044157610441610398565b604051601f8201601f19908116603f0116810190838211818310171561046957610469610398565b8160405282815289602084870101111561048257600080fd5b6104938360208301602088016103ae565b80955050505050509250925092565b818103818111156101bc57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052600160045260246000fd5b600082516104eb8184602087016103ae565b9190910192915050565b60208152600082518060208401526105148160408501602087016103ae565b601f01601f19169190910160400192915050565b6080516108d76105656000396000818160fc0152818161015f015281816101ee015281816102450152818161028301526102a701526108d76000f3fe6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100cb57610052565b36610052576100506100e0565b005b6100506100e0565b34801561006657600080fd5b5061005061007536600461074b565b6100fa565b610050610088366004610766565b61015d565b34801561009957600080fd5b506100a26101ea565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d757600080fd5b506100a2610241565b6100e86102a5565b6100f86100f3610395565b6103d5565b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361015557610152816040518060200160405280600081525060006103f9565b50565b6101526100e0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036101e2576101dd8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103f9915050565b505050565b6101dd6100e0565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657610231610395565b905090565b61023e6100e0565b90565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657507f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036100f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b3660008037600080366000845af43d6000803e8080156103f4573d6000f35b3d6000fd5b61040283610424565b60008251118061040f5750805b156101dd5761041e8383610471565b50505050565b61042d8161049d565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610496838360405180606001604052806027815260200161087b602791396105a7565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81163b610541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161038c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606073ffffffffffffffffffffffffffffffffffffffff84163b61064d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161038c565b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051610675919061080d565b600060405180830381855af49150503d80600081146106b0576040519150601f19603f3d011682016040523d82523d6000602084013e6106b5565b606091505b50915091506106c58282866106cf565b9695505050505050565b606083156106de575081610496565b8251156106ee5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038c9190610829565b803573ffffffffffffffffffffffffffffffffffffffff8116811461074657600080fd5b919050565b60006020828403121561075d57600080fd5b61049682610722565b60008060006040848603121561077b57600080fd5b61078484610722565b9250602084013567ffffffffffffffff808211156107a157600080fd5b818601915086601f8301126107b557600080fd5b8135818111156107c457600080fd5b8760208285010111156107d657600080fd5b6020830194508093505050509250925092565b60005b838110156108045781810151838201526020016107ec565b50506000910152565b6000825161081f8184602087016107e9565b9190910192915050565b60208152600082518060208401526108488160408501602087016107e9565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200136fd34dfdb0d97935b77a84c836b17bf901cefa29ed5b1ef847b08c6cba8d064736f6c63430008190033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100cb57610052565b36610052576100506100e0565b005b6100506100e0565b34801561006657600080fd5b5061005061007536600461074b565b6100fa565b610050610088366004610766565b61015d565b34801561009957600080fd5b506100a26101ea565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d757600080fd5b506100a2610241565b6100e86102a5565b6100f86100f3610395565b6103d5565b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361015557610152816040518060200160405280600081525060006103f9565b50565b6101526100e0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036101e2576101dd8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103f9915050565b505050565b6101dd6100e0565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657610231610395565b905090565b61023e6100e0565b90565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657507f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036100f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b3660008037600080366000845af43d6000803e8080156103f4573d6000f35b3d6000fd5b61040283610424565b60008251118061040f5750805b156101dd5761041e8383610471565b50505050565b61042d8161049d565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610496838360405180606001604052806027815260200161087b602791396105a7565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81163b610541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161038c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606073ffffffffffffffffffffffffffffffffffffffff84163b61064d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161038c565b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051610675919061080d565b600060405180830381855af49150503d80600081146106b0576040519150601f19603f3d011682016040523d82523d6000602084013e6106b5565b606091505b50915091506106c58282866106cf565b9695505050505050565b606083156106de575081610496565b8251156106ee5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038c9190610829565b803573ffffffffffffffffffffffffffffffffffffffff8116811461074657600080fd5b919050565b60006020828403121561075d57600080fd5b61049682610722565b60008060006040848603121561077b57600080fd5b61078484610722565b9250602084013567ffffffffffffffff808211156107a157600080fd5b818601915086601f8301126107b557600080fd5b8135818111156107c457600080fd5b8760208285010111156107d657600080fd5b6020830194508093505050509250925092565b60005b838110156108045781810151838201526020016107ec565b50506000910152565b6000825161081f8184602087016107e9565b9190910192915050565b60208152600082518060208401526108488160408501602087016107e9565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200136fd34dfdb0d97935b77a84c836b17bf901cefa29ed5b1ef847b08c6cba8d064736f6c63430008190033", + "execute": { + "methodName": "initialize", + "args": ["0x724138223D8F76b519fdE715f60124E7Ce51e051", 20] + }, + "implementation": "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is upgraded." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/basesepolia/ProtocolShareReserve_Implementation.json b/deployments/basesepolia/ProtocolShareReserve_Implementation.json new file mode 100644 index 00000000..809dae77 --- /dev/null +++ b/deployments/basesepolia/ProtocolShareReserve_Implementation.json @@ -0,0 +1,1285 @@ +{ + "address": "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_corePoolComptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "_wbnb", + "type": "address" + }, + { + "internalType": "address", + "name": "_vbnb", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xbfc94620fcfe2bcdb0db49f025ce859a634217d0d8d3c27a951e11ca461a4d3f", + "receipt": { + "to": null, + "from": "0x646413D07084c4C9B07C023a2207ad0b5292094d", + "contractAddress": "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "transactionIndex": 8, + "gasUsed": "2574496", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x00c645e1b04b993ad5a8531e7943a26128fd65608166098f605d369615e66fc1", + "transactionHash": "0xbfc94620fcfe2bcdb0db49f025ce859a634217d0d8d3c27a951e11ca461a4d3f", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 17905502, + "transactionHash": "0xbfc94620fcfe2bcdb0db49f025ce859a634217d0d8d3c27a951e11ca461a4d3f", + "address": "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 10, + "blockHash": "0x00c645e1b04b993ad5a8531e7943a26128fd65608166098f605d369615e66fc1" + } + ], + "blockNumber": 17905502, + "cumulativeGasUsed": "3465909", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000001" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_corePoolComptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wbnb\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vbnb\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTotalPercentage\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"loopsLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredLoops\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"percent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IProtocolShareReserve.IncomeType\",\"name\":\"incomeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"AssetsReservesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"DistributionConfigAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"DistributionConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"oldPercentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newPercentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"DistributionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMaxLoopsLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newmaxLoopsLimit\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldPoolRegistry\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPoolRegistry\",\"type\":\"address\"}],\"name\":\"PoolRegistryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"ReservesUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CORE_POOL_COMPTROLLER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_PERCENT\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct ProtocolShareReserve.DistributionConfig[]\",\"name\":\"configs\",\"type\":\"tuple[]\"}],\"name\":\"addOrUpdateDistributionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"\",\"type\":\"uint8\"}],\"name\":\"assetsReserves\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"distributionTargets\",\"outputs\":[{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"getPercentageDistribution\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getUnreleasedFunds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_loopsLimit\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLoopsLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"assets\",\"type\":\"address[]\"}],\"name\":\"releaseFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"removeDistributionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_poolRegistry\",\"type\":\"address\"}],\"name\":\"setPoolRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"totalAssetReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalDistributions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"enum IProtocolShareReserve.IncomeType\",\"name\":\"incomeType\",\"type\":\"uint8\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"addOrUpdateDistributionConfigs((uint8,uint16,address)[])\":{\"details\":\"Add or update destination targets based on destination address\",\"params\":{\"configs\":\"configurations of the destinations.\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"getPercentageDistribution(address,uint8)\":{\"details\":\"Used to find out the percentage distribution for a particular destination based on schema\",\"params\":{\"destination\":\"the destination address of the distribution target\",\"schema\":\"the schema of the distribution target\"},\"returns\":{\"_0\":\"percentage percentage distribution\"}},\"getUnreleasedFunds(address,uint8,address,address)\":{\"details\":\"Used to find out the amount of funds that's going to be released when release funds is called.\",\"params\":{\"asset\":\"the asset address which will be released\",\"comptroller\":\"the comptroller address of the pool\",\"destination\":\"the destination address of the distribution target\",\"schema\":\"the schema of the distribution target\"}},\"initialize(address,uint256)\":{\"details\":\"Initializes the deployer to owner.\",\"params\":{\"_accessControlManager\":\"The address of ACM contract\",\"_loopsLimit\":\"Limit for the loops in the contract to avoid DOS\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"releaseFunds(address,address[])\":{\"details\":\"Release funds\",\"params\":{\"assets\":\"assets to be released to distribution targets\",\"comptroller\":\"the comptroller address of the pool\"}},\"removeDistributionConfig(uint8,address)\":{\"details\":\"Remove destionation target if percentage is 0\",\"params\":{\"destination\":\"destination address of the configuration\",\"schema\":\"schema of the configuration\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setPoolRegistry(address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when pool registry address is zero\",\"details\":\"Pool registry setter.\",\"params\":{\"_poolRegistry\":\"Address of the pool registry\"}},\"totalDistributions()\":{\"details\":\"Returns the total number of distribution targets\"},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address,uint8)\":{\"details\":\"Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\",\"params\":{\"asset\":\"Asset address.\",\"comptroller\":\"Comptroller address (pool)\",\"incomeType\":\"type of income\"}}},\"stateVariables\":{\"CORE_POOL_COMPTROLLER\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"WBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"version\":1},\"userdoc\":{\"errors\":{\"MaxLoopsLimitExceeded(uint256,uint256)\":[{\"notice\":\"Thrown an error on maxLoopsLimit exceeds for any loop\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}]},\"events\":{\"AssetReleased(address,address,uint8,uint256,uint256)\":{\"notice\":\"Event emitted when an asset is released to a target\"},\"AssetsReservesUpdated(address,address,uint256,uint8,uint8)\":{\"notice\":\"Event emitted after updating of the assets reserves.\"},\"DistributionConfigAdded(address,uint16,uint8)\":{\"notice\":\"Event emitted when distribution configuration is added\"},\"DistributionConfigRemoved(address,uint16,uint8)\":{\"notice\":\"Event emitted when distribution configuration is removed\"},\"DistributionConfigUpdated(address,uint16,uint16,uint8)\":{\"notice\":\"Event emitted when distribution configuration is updated\"},\"MaxLoopsLimitUpdated(uint256,uint256)\":{\"notice\":\"Emitted when max loops limit is set\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PoolRegistryUpdated(address,address)\":{\"notice\":\"Emitted when pool registry address is updated\"},\"ReservesUpdated(address,address,uint8,uint256,uint256)\":{\"notice\":\"Event emitted when asset reserves state is updated\"}},\"kind\":\"user\",\"methods\":{\"CORE_POOL_COMPTROLLER()\":{\"notice\":\"address of core pool comptroller contract\"},\"WBNB()\":{\"notice\":\"address of WBNB contract\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"assetsReserves(address,address,uint8)\":{\"notice\":\"comptroller => asset => schema => balance\"},\"distributionTargets(uint256)\":{\"notice\":\"configuration for different income distribution targets\"},\"poolRegistry()\":{\"notice\":\"address of pool registry contract\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"totalAssetReserve(address)\":{\"notice\":\"asset => balance\"},\"vBNB()\":{\"notice\":\"address of vBNB contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProtocolReserve/ProtocolShareReserve.sol\":\"ProtocolShareReserve\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\\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\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\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 cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/**\\n * @title MaxLoopsLimitHelper\\n * @author Venus\\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\\n */\\nabstract contract MaxLoopsLimitHelper {\\n // Limit for the loops to avoid the DOS\\n uint256 public maxLoopsLimit;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when max loops limit is set\\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\\n\\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\\n\\n /**\\n * @notice Set the limit for the loops can iterate to avoid the DOS\\n * @param limit Limit for the max loops can execute at a time\\n */\\n function _setMaxLoopsLimit(uint256 limit) internal {\\n require(limit > maxLoopsLimit, \\\"Comptroller: Invalid maxLoopsLimit\\\");\\n\\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\\n maxLoopsLimit = limit;\\n\\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\\n }\\n\\n /**\\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\\n * @param len Length of the loops iterate\\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\\n */\\n function _ensureMaxLoops(uint256 len) internal view {\\n if (len > maxLoopsLimit) {\\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4c25e30635485d162177effa384eee51768b0141a567a0da16ff6ad673274166\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IComptroller.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IComptroller {\\n function isComptroller() external view returns (bool);\\n\\n function markets(address) external view returns (bool);\\n\\n function getAllMarkets() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xeeb8e8d4c749f6aa69cd7740161bc5f4e802199b147ce98961d742aa1bbaf3bf\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IIncomeDestination.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IIncomeDestination {\\n function updateAssetsState(address comptroller, address asset) external;\\n}\\n\",\"keccak256\":\"0x421edd67af6a7c5edcf321e64ea6a56b5cadbbd7ff4b7faf8b2a70891800584b\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IPoolRegistry {\\n /// @notice Get VToken in the Pool for an Asset\\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\\n\\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xf92fa4b736309b63de1e9a4025e9d471b2bff34c00a4c0e37193a1d109fd36d4\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IProtocolShareReserve.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IProtocolShareReserve {\\n /// @notice it represents the type of vToken income\\n enum IncomeType {\\n SPREAD,\\n LIQUIDATION\\n }\\n\\n function updateAssetsState(\\n address comptroller,\\n address asset,\\n IncomeType incomeType\\n ) external;\\n}\\n\",\"keccak256\":\"0x5fddc5b63fdd850b3b5c83576cda50dcb27a205dbb1a23af17d9da0d9f04fa0a\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IVToken.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IVToken {\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x2d10d295f7f5d2288840dd20e752eb9a997603af7fbc14f0770174591b5fa5d7\",\"license\":\"BSD-3-Clause\"},\"contracts/ProtocolReserve/ProtocolShareReserve.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SafeERC20Upgradeable, IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { MaxLoopsLimitHelper } from \\\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { IProtocolShareReserve } from \\\"../Interfaces/IProtocolShareReserve.sol\\\";\\nimport { IComptroller } from \\\"../Interfaces/IComptroller.sol\\\";\\nimport { IPoolRegistry } from \\\"../Interfaces/IPoolRegistry.sol\\\";\\nimport { IVToken } from \\\"../Interfaces/IVToken.sol\\\";\\nimport { IIncomeDestination } from \\\"../Interfaces/IIncomeDestination.sol\\\";\\n\\nerror InvalidAddress();\\nerror UnsupportedAsset();\\nerror InvalidTotalPercentage();\\nerror InvalidMaxLoopsLimit();\\n\\ncontract ProtocolShareReserve is\\n AccessControlledV8,\\n ReentrancyGuardUpgradeable,\\n MaxLoopsLimitHelper,\\n IProtocolShareReserve\\n{\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice protocol income is categorized into two schemas.\\n /// The first schema is for spread income\\n /// The second schema is for liquidation income\\n enum Schema {\\n PROTOCOL_RESERVES,\\n ADDITIONAL_REVENUE\\n }\\n\\n struct DistributionConfig {\\n Schema schema;\\n /// @dev percenatge is represented without any scale\\n uint16 percentage;\\n address destination;\\n }\\n\\n /// @notice address of core pool comptroller contract\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable CORE_POOL_COMPTROLLER;\\n\\n /// @notice address of WBNB contract\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable WBNB;\\n\\n /// @notice address of vBNB contract\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vBNB;\\n\\n /// @notice address of pool registry contract\\n address public poolRegistry;\\n\\n uint16 public constant MAX_PERCENT = 1e4;\\n\\n /// @notice comptroller => asset => schema => balance\\n mapping(address => mapping(address => mapping(Schema => uint256))) public assetsReserves;\\n\\n /// @notice asset => balance\\n mapping(address => uint256) public totalAssetReserve;\\n\\n /// @notice configuration for different income distribution targets\\n DistributionConfig[] public distributionTargets;\\n\\n /// @notice Emitted when pool registry address is updated\\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\\n\\n /// @notice Event emitted after updating of the assets reserves.\\n event AssetsReservesUpdated(\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount,\\n IncomeType incomeType,\\n Schema schema\\n );\\n\\n /// @notice Event emitted when an asset is released to a target\\n event AssetReleased(\\n address indexed destination,\\n address indexed asset,\\n Schema schema,\\n uint256 percent,\\n uint256 amount\\n );\\n\\n /// @notice Event emitted when asset reserves state is updated\\n event ReservesUpdated(\\n address indexed comptroller,\\n address indexed asset,\\n Schema schema,\\n uint256 oldBalance,\\n uint256 newBalance\\n );\\n\\n /// @notice Event emitted when distribution configuration is updated\\n event DistributionConfigUpdated(\\n address indexed destination,\\n uint16 oldPercentage,\\n uint16 newPercentage,\\n Schema schema\\n );\\n\\n /// @notice Event emitted when distribution configuration is added\\n event DistributionConfigAdded(address indexed destination, uint16 percentage, Schema schema);\\n\\n /// @notice Event emitted when distribution configuration is removed\\n event DistributionConfigRemoved(address indexed destination, uint16 percentage, Schema schema);\\n\\n /**\\n * @dev Constructor to initialize the immutable variables\\n * @param _corePoolComptroller The address of core pool comptroller\\n * @param _wbnb The address of WBNB\\n * @param _vbnb The address of vBNB\\n */\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address _corePoolComptroller,\\n address _wbnb,\\n address _vbnb\\n ) {\\n ensureNonzeroAddress(_corePoolComptroller);\\n ensureNonzeroAddress(_wbnb);\\n ensureNonzeroAddress(_vbnb);\\n\\n CORE_POOL_COMPTROLLER = _corePoolComptroller;\\n WBNB = _wbnb;\\n vBNB = _vbnb;\\n\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the deployer to owner.\\n * @param _accessControlManager The address of ACM contract\\n * @param _loopsLimit Limit for the loops in the contract to avoid DOS\\n */\\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\\n __AccessControlled_init(_accessControlManager);\\n __ReentrancyGuard_init();\\n _setMaxLoopsLimit(_loopsLimit);\\n }\\n\\n /**\\n * @dev Pool registry setter.\\n * @param _poolRegistry Address of the pool registry\\n * @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n */\\n function setPoolRegistry(address _poolRegistry) external onlyOwner {\\n ensureNonzeroAddress(_poolRegistry);\\n emit PoolRegistryUpdated(poolRegistry, _poolRegistry);\\n poolRegistry = _poolRegistry;\\n }\\n\\n /**\\n * @dev Add or update destination targets based on destination address\\n * @param configs configurations of the destinations.\\n */\\n function addOrUpdateDistributionConfigs(DistributionConfig[] calldata configs) external nonReentrant {\\n _checkAccessAllowed(\\\"addOrUpdateDistributionConfigs(DistributionConfig[])\\\");\\n\\n for (uint256 i = 0; i < configs.length; ) {\\n DistributionConfig memory _config = configs[i];\\n ensureNonzeroAddress(_config.destination);\\n\\n bool updated = false;\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 j = 0; j < distributionTargetsLength; ) {\\n DistributionConfig storage config = distributionTargets[j];\\n\\n if (_config.schema == config.schema && config.destination == _config.destination) {\\n emit DistributionConfigUpdated(\\n _config.destination,\\n config.percentage,\\n _config.percentage,\\n _config.schema\\n );\\n config.percentage = _config.percentage;\\n updated = true;\\n break;\\n }\\n\\n unchecked {\\n ++j;\\n }\\n }\\n\\n if (!updated) {\\n distributionTargets.push(_config);\\n emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n _ensurePercentages();\\n _ensureMaxLoops(distributionTargets.length);\\n }\\n\\n /**\\n * @dev Remove destionation target if percentage is 0\\n * @param schema schema of the configuration\\n * @param destination destination address of the configuration\\n */\\n function removeDistributionConfig(Schema schema, address destination) external {\\n _checkAccessAllowed(\\\"removeDistributionConfig(Schema,address)\\\");\\n\\n uint256 distributionIndex;\\n bool found = false;\\n for (uint256 i = 0; i < distributionTargets.length; ) {\\n DistributionConfig storage config = distributionTargets[i];\\n\\n if (schema == config.schema && destination == config.destination && config.percentage == 0) {\\n found = true;\\n distributionIndex = i;\\n break;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n if (found) {\\n emit DistributionConfigRemoved(\\n distributionTargets[distributionIndex].destination,\\n distributionTargets[distributionIndex].percentage,\\n distributionTargets[distributionIndex].schema\\n );\\n\\n distributionTargets[distributionIndex] = distributionTargets[distributionTargets.length - 1];\\n distributionTargets.pop();\\n }\\n\\n _ensurePercentages();\\n }\\n\\n /**\\n * @dev Release funds\\n * @param comptroller the comptroller address of the pool\\n * @param assets assets to be released to distribution targets\\n */\\n function releaseFunds(address comptroller, address[] calldata assets) external nonReentrant {\\n for (uint256 i = 0; i < assets.length; ) {\\n _releaseFund(comptroller, assets[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Used to find out the amount of funds that's going to be released when release funds is called.\\n * @param comptroller the comptroller address of the pool\\n * @param schema the schema of the distribution target\\n * @param destination the destination address of the distribution target\\n * @param asset the asset address which will be released\\n */\\n function getUnreleasedFunds(\\n address comptroller,\\n Schema schema,\\n address destination,\\n address asset\\n ) external view returns (uint256) {\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 i = 0; i < distributionTargetsLength; ) {\\n DistributionConfig storage _config = distributionTargets[i];\\n if (_config.schema == schema && _config.destination == destination) {\\n uint256 total = assetsReserves[comptroller][asset][schema];\\n return (total * _config.percentage) / MAX_PERCENT;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the total number of distribution targets\\n */\\n function totalDistributions() external view returns (uint256) {\\n return distributionTargets.length;\\n }\\n\\n /**\\n * @dev Used to find out the percentage distribution for a particular destination based on schema\\n * @param destination the destination address of the distribution target\\n * @param schema the schema of the distribution target\\n * @return percentage percentage distribution\\n */\\n function getPercentageDistribution(address destination, Schema schema) external view returns (uint256) {\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 i = 0; i < distributionTargetsLength; ) {\\n DistributionConfig memory config = distributionTargets[i];\\n\\n if (config.destination == destination && config.schema == schema) {\\n return config.percentage;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\\n * @param comptroller Comptroller address (pool)\\n * @param asset Asset address.\\n * @param incomeType type of income\\n */\\n function updateAssetsState(\\n address comptroller,\\n address asset,\\n IncomeType incomeType\\n ) public override(IProtocolShareReserve) nonReentrant {\\n if (!IComptroller(comptroller).isComptroller()) revert InvalidAddress();\\n ensureNonzeroAddress(asset);\\n\\n if (\\n comptroller != CORE_POOL_COMPTROLLER &&\\n IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) == address(0)\\n ) revert InvalidAddress();\\n\\n Schema schema = _getSchema(incomeType);\\n uint256 currentBalance = IERC20Upgradeable(asset).balanceOf(address(this));\\n uint256 assetReserve = totalAssetReserve[asset];\\n\\n if (currentBalance > assetReserve) {\\n uint256 balanceDifference;\\n unchecked {\\n balanceDifference = currentBalance - assetReserve;\\n }\\n\\n assetsReserves[comptroller][asset][schema] += balanceDifference;\\n totalAssetReserve[asset] += balanceDifference;\\n emit AssetsReservesUpdated(comptroller, asset, balanceDifference, incomeType, schema);\\n }\\n }\\n\\n /**\\n * @dev asset from a particular pool to be release to distribution targets\\n * @param comptroller Comptroller address(pool)\\n * @param asset Asset address.\\n */\\n function _releaseFund(address comptroller, address asset) internal {\\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\\n uint256[] memory schemaBalances = new uint256[](totalSchemas);\\n uint256 totalBalance;\\n for (uint256 schemaValue; schemaValue < totalSchemas; ) {\\n schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];\\n totalBalance += schemaBalances[schemaValue];\\n\\n unchecked {\\n ++schemaValue;\\n }\\n }\\n\\n if (totalBalance == 0) {\\n return;\\n }\\n\\n uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);\\n for (uint256 i = 0; i < distributionTargets.length; ) {\\n DistributionConfig memory _config = distributionTargets[i];\\n\\n uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;\\n totalTransferAmounts[uint256(_config.schema)] += transferAmount;\\n\\n if (transferAmount != 0) {\\n IERC20Upgradeable(asset).safeTransfer(_config.destination, transferAmount);\\n IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);\\n\\n emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n uint256[] memory newSchemaBalances = new uint256[](totalSchemas);\\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\\n newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];\\n assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];\\n totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];\\n\\n emit ReservesUpdated(\\n comptroller,\\n asset,\\n Schema(schemaValue),\\n schemaBalances[schemaValue],\\n newSchemaBalances[schemaValue]\\n );\\n\\n unchecked {\\n ++schemaValue;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the schema based on income type\\n * @param incomeType type of income\\n * @return schema schema for distribution\\n */\\n function _getSchema(IncomeType incomeType) internal view returns (Schema schema) {\\n schema = Schema.ADDITIONAL_REVENUE;\\n\\n if (incomeType == IncomeType.SPREAD) {\\n schema = Schema.PROTOCOL_RESERVES;\\n }\\n }\\n\\n /**\\n * @dev This ensures that the total percentage of all the distribution targets is 100% or 0%\\n */\\n function _ensurePercentages() internal view {\\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\\n uint16[] memory totalPercentages = new uint16[](totalSchemas);\\n\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 i = 0; i < distributionTargetsLength; ) {\\n DistributionConfig memory config = distributionTargets[i];\\n totalPercentages[uint256(config.schema)] += config.percentage;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\\n if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)\\n revert InvalidTotalPercentage();\\n\\n unchecked {\\n ++schemaValue;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the underlying asset address for the vToken\\n * @param vToken vToken address\\n * @return asset address of asset\\n */\\n function _getUnderlying(address vToken) internal view returns (address) {\\n if (vToken == vBNB) {\\n return WBNB;\\n } else {\\n return IVToken(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa055981f35a958ff20ca595ffc1a93a331d06159d728e1c1d766d4545bc1ad52\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60e060405234801561001057600080fd5b50604051612f32380380612f3283398101604081905261002f91610178565b61003883610073565b61004182610073565b61004a81610073565b6001600160a01b0380841660805282811660a052811660c05261006b61009d565b5050506101bb565b6001600160a01b03811661009a576040516342bcdf7f60e11b815260040160405180910390fd5b50565b600054610100900460ff16156101095760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161461015a576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b038116811461017357600080fd5b919050565b60008060006060848603121561018d57600080fd5b6101968461015c565b92506101a46020850161015c565b91506101b26040850161015c565b90509250925092565b60805160a05160c051612d416101f16000396000610209015260006103090152600081816103c901526104bc0152612d416000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c8063893ffe98116100ee578063b4a0bdf311610097578063e30c397811610071578063e30c3978146103a0578063f2fde38b146103b1578063fa7b81a0146103c4578063fc31116a146103eb57600080fd5b8063b4a0bdf314610373578063be26317e14610384578063cd6dc6871461038d57600080fd5b8063966961f0116100c8578063966961f01461032b578063aea211211461033e578063afcff50f1461035f57600080fd5b8063893ffe98146102e05780638da5cb5b146102f35780638dd950021461030457600080fd5b80634f429f3611610150578063715018a61161012a578063715018a6146102bd57806379ba5097146102c55780637b77cd6a146102cd57600080fd5b80634f429f36146102655780635db6da12146102785780635f3d6133146102aa57600080fd5b806316faecec1161018157806316faecec146101f157806333e1567f14610204578063392ee7121461024357600080fd5b80630e32cb86146101a85780631036bbe2146101bd578063163db71b146101de575b600080fd5b6101bb6101b63660046125a8565b6103fe565b005b6101c661271081565b60405161ffff90911681526020015b60405180910390f35b610130545b6040519081526020016101d5565b6101bb6101ff3660046125d9565b610412565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d5565b610256610251366004612624565b610788565b6040516101d5939291906126a3565b6101bb6102733660046126d1565b6107c8565b6101e36102863660046125d9565b61012e60209081526000938452604080852082529284528284209052825290205481565b6101bb6102b836600461270a565b610b0a565b6101bb610e19565b6101bb610e2d565b6101bb6102db3660046125a8565b610ebd565b6101e36102ee36600461277f565b610f44565b6033546001600160a01b031661022b565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101e36103393660046127db565b611066565b6101e361034c3660046125a8565b61012f6020526000908152604090205481565b61012d5461022b906001600160a01b031681565b6097546001600160a01b031661022b565b6101e360fb5481565b6101bb61039b366004612809565b61115b565b6065546001600160a01b031661022b565b6101bb6103bf3660046125a8565b6112e6565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101bb6103f9366004612835565b61136f565b6104066113c5565b61040f8161141f565b50565b61041a611515565b826001600160a01b0316627e3dd26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906128bd565b6104b1576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104ba8261156e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614158015610593575061012d546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058891906128df565b6001600160a01b0316145b156105ca576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105d5826115ae565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038516906370a0823190602401602060405180830381865afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065c91906128fc565b6001600160a01b038516600090815261012f602052604090205490915080821115610776576001600160a01b03808716600090815261012e602090815260408083209389168352929052908120828403918291908660018111156106c2576106c261263d565b60018111156106d3576106d361263d565b815260200190815260200160002060008282546106f09190612944565b90915550506001600160a01b038616600090815261012f60205260408120805483929061071e908490612944565b92505081905550856001600160a01b0316876001600160a01b03167fa46b2431e663cf7b50c9d5129aff85d2394ecfd447b7ccba83986510a9d945ea83888860405161076c93929190612957565b60405180910390a3505b505050610783600160c955565b505050565b610130818154811061079957600080fd5b60009182526020909120015460ff81169150610100810461ffff1690630100000090046001600160a01b031683565b6107e9604051806060016040528060288152602001612cb0602891396115d9565b600080805b61013054811015610894576000610130828154811061080f5761080f612984565b6000918252602090912001805490915060ff1660018111156108335761083361263d565b8660018111156108455761084561263d565b148015610865575080546001600160a01b03868116630100000090920416145b801561087957508054610100900461ffff16155b1561088b576001925081935050610894565b506001016107ee565b508015610afc5761013082815481106108af576108af612984565b9060005260206000200160000160039054906101000a90046001600160a01b03166001600160a01b03167f70e7a210881df49522a5bf05d477e00d59e52a41c96c1eedeaeb356b9e6c81cc610130848154811061090e5761090e612984565b9060005260206000200160000160019054906101000a900461ffff16610130858154811061093e5761093e612984565b60009182526020909120015460405161095b929160ff16906129b3565b60405180910390a26101308054610974906001906129d4565b8154811061098457610984612984565b9060005260206000200161013083815481106109a2576109a2612984565b60009182526020909120825491018054909160ff169082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183818111156109ef576109ef61263d565b02179055508154815461ffff61010092839004169091027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff82168117835592546001600160a01b0363010000009182900416027fffffffffffffffffff0000000000000000000000000000000000000000ffffff9093167fffffffffffffffffff00000000000000000000000000000000000000000000ff90911617919091179055610130805480610aa357610aa36129e7565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffff00000000000000000000000000000000000000000000001690550190555b610b046116a5565b50505050565b610b12611515565b610b33604051806060016040528060348152602001612cd8603491396115d9565b60005b81811015610df5576000838383818110610b5257610b52612984565b905060600201803603810190610b689190612a45565b9050610b77816040015161156e565b61013054600090815b81811015610ca55760006101308281548110610b9e57610b9e612984565b6000918252602090912001805490915060ff166001811115610bc257610bc261263d565b85516001811115610bd557610bd561263d565b148015610bfa575060408501518154630100000090046001600160a01b039081169116145b15610c9c5760408581015182546020880151885193516001600160a01b03909316937fa682db621f4ae1c92cd6c492151d32fe657fc6db6e87bd65eb8bda05311f6ef293610c5393610100900461ffff16929190612ae5565b60405180910390a26020850151815461ffff909116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff90911617905560019250610ca5565b50600101610b80565b5081610de75761013080546001818101835560009290925284517f2f605e086faac1d93117bbfbc18835d434e9405fadc1ca66faf4b864746daf349091018054869391929183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908381811115610d2057610d2061263d565b021790555060208281015182546040948501517fffffffffffffffffff00000000000000000000000000000000000000000000ff90911661010061ffff909316929092027fffffffffffffffffff0000000000000000000000000000000000000000ffffff169190911763010000006001600160a01b03928316021790925585830151908601518651935191909216927f8c96910d818618d8b1de4e1b5672a192443e87aa553f0ebe4c47f9d8c928b28292610dde929091906129b3565b60405180910390a25b836001019350505050610b36565b50610dfe6116a5565b61013054610e0b9061187d565b610e15600160c955565b5050565b610e216113c5565b610e2b60006118c7565b565b60655433906001600160a01b03168114610eb45760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61040f816118c7565b610ec56113c5565b610ece8161156e565b61012d546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61013054600090815b8181101561105b5760006101308281548110610f6b57610f6b612984565b906000526020600020019050866001811115610f8957610f8961263d565b815460ff166001811115610f9f57610f9f61263d565b148015610fbf575080546001600160a01b03878116630100000090920416145b15611052576001600160a01b03808916600090815261012e60209081526040808320938916835292905290812081896001811115610fff57610fff61263d565b60018111156110105761101061263d565b815260208101919091526040016000205482549091506127109061103d90610100900461ffff1683612b01565b6110479190612b18565b94505050505061105e565b50600101610f4d565b50505b949350505050565b61013054600090815b81811015611152576000610130828154811061108d5761108d612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156110bc576110bc61263d565b60018111156110cd576110cd61263d565b81529054610100810461ffff166020830152630100000090046001600160a01b03908116604092830152908201519192508781169116148015611132575084600181111561111d5761111d61263d565b815160018111156111305761113061263d565b145b15611149576020015161ffff169250611155915050565b5060010161106f565b50505b92915050565b600054610100900460ff161580801561117b5750600054600160ff909116105b806111955750303b158015611195575060005460ff166001145b6112075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610eab565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561126557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61126e836118f8565b611276611986565b61127f82611a0b565b801561078357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6112ee6113c5565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556113376033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611377611515565b60005b818110156113ba576113b28484848481811061139857611398612984565b90506020020160208101906113ad91906125a8565b611ac0565b60010161137a565b50610783600160c955565b6033546001600160a01b03163314610e2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eab565b6001600160a01b03811661149b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610eab565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b600260c954036115675760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eab565b600260c955565b6001600160a01b03811661040f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008260018111156115c4576115c461263d565b036115cd575060005b919050565b600160c955565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906116259033908690600401612bc1565b602060405180830381865afa158015611642573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166691906128bd565b905080610e15573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610eab93929190612be3565b60006116b2600180612944565b905060008167ffffffffffffffff8111156116cf576116cf612a16565b6040519080825280602002602001820160405280156116f8578160200160208202803683370190505b506101305490915060005b818110156117e1576000610130828154811061172157611721612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156117505761175061263d565b60018111156117615761176161263d565b81529054610100810461ffff1660208084019190915263010000009091046001600160a01b0316604090920191909152810151815191925090859060018111156117ad576117ad61263d565b815181106117bd576117bd612984565b602002602001018181516117d19190612c18565b61ffff1690525050600101611703565b5060005b83811015610b045761271061ffff1683828151811061180657611806612984565b602002602001015161ffff161415801561183e575082818151811061182d5761182d612984565b602002602001015161ffff16600014155b15611875576040517f0b8ad7f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001016117e5565b60fb5481111561040f5760fb546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610eab565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561040f81612099565b600054610100900460ff166119755760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b61197d612103565b61040f81612188565b600054610100900460ff16611a035760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612205565b60fb548111611a825760405162461bcd60e51b815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610eab565b60fb80549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101611509565b6000611acd600180612944565b905060008167ffffffffffffffff811115611aea57611aea612a16565b604051908082528060200260200182016040528015611b13578160200160208202803683370190505b5090506000805b83811015611bdb576001600160a01b03808716600090815261012e60209081526040808320938916835292905290812090826001811115611b5d57611b5d61263d565b6001811115611b6e57611b6e61263d565b6001811115611b7f57611b7f61263d565b815260200190815260200160002054838281518110611ba057611ba0612984565b602002602001018181525050828181518110611bbe57611bbe612984565b602002602001015182611bd19190612944565b9150600101611b1a565b5080600003611beb575050505050565b60008367ffffffffffffffff811115611c0657611c06612a16565b604051908082528060200260200182016040528015611c2f578160200160208202803683370190505b50905060005b61013054811015611e645760006101308281548110611c5657611c56612984565b60009182526020909120604080516060810190915291018054829060ff166001811115611c8557611c8561263d565b6001811115611c9657611c9661263d565b81529054610100810461ffff90811660208085019190915263010000009092046001600160a01b0316604090930192909252820151825192935060009261271092919091169088906001811115611cef57611cef61263d565b81518110611cff57611cff612984565b6020026020010151611d119190612b01565b611d1b9190612b18565b9050808483600001516001811115611d3557611d3561263d565b81518110611d4557611d45612984565b60200260200101818151611d599190612944565b9052508015611e5a576040820151611d7c906001600160a01b038a169083612282565b60408083015190517faac59a750000000000000000000000000000000000000000000000000000000081526001600160a01b038b811660048301528a811660248301529091169063aac59a7590604401600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b50505050876001600160a01b031682604001516001600160a01b03167f09f71e7b22d78540ee9a42f09917a9d62f46735cb0dfa70d6bab27866d9cb5008460000151856020015185604051611e5193929190612c3a565b60405180910390a35b5050600101611c35565b5060008467ffffffffffffffff811115611e8057611e80612a16565b604051908082528060200260200182016040528015611ea9578160200160208202803683370190505b50905060005b8581101561208f57828181518110611ec957611ec9612984565b6020026020010151858281518110611ee357611ee3612984565b6020026020010151611ef591906129d4565b828281518110611f0757611f07612984565b602002602001018181525050818181518110611f2557611f25612984565b6020908102919091018101516001600160a01b03808b16600090815261012e84526040808220928c1682529190935282209091836001811115611f6a57611f6a61263d565b6001811115611f7b57611f7b61263d565b6001811115611f8c57611f8c61263d565b815260200190815260200160002081905550828181518110611fb057611fb0612984565b602002602001015161012f6000896001600160a01b03166001600160a01b0316815260200190815260200160002054611fe991906129d4565b6001600160a01b03808916600081815261012f602052604090209290925589167f7d881f3d6246a6a2b97b121b8ba093c17497912c68e8b2bca6108528e91df3ca83600181111561203c5761203c61263d565b88858151811061204e5761204e612984565b602002602001015186868151811061206857612068612984565b602002602001015160405161207f93929190612c5f565b60405180910390a3600101611eaf565b5050505050505050565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166121805760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612302565b600054610100900460ff166104065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b600054610100900460ff166115d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610783908490612388565b600054610100900460ff1661237f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b336118c7565b60006123dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124709092919063ffffffff16565b90508051600014806123fe5750808060200190518101906123fe91906128bd565b6107835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610eab565b606061105e848460008585600080866001600160a01b031685876040516124979190612c80565b60006040518083038185875af1925050503d80600081146124d4576040519150601f19603f3d011682016040523d82523d6000602084013e6124d9565b606091505b50915091506124ea878383876124f5565b979650505050505050565b6060831561256457825160000361255d576001600160a01b0385163b61255d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610eab565b508161105e565b61105e83838151156125795781518083602001fd5b8060405162461bcd60e51b8152600401610eab9190612c9c565b6001600160a01b038116811461040f57600080fd5b6000602082840312156125ba57600080fd5b81356125c581612593565b9392505050565b6002811061040f57600080fd5b6000806000606084860312156125ee57600080fd5b83356125f981612593565b9250602084013561260981612593565b91506040840135612619816125cc565b809150509250925092565b60006020828403121561263657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061040f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b606081016126b08561266c565b93815261ffff9290921660208301526001600160a01b031660409091015290565b600080604083850312156126e457600080fd5b82356126ef816125cc565b915060208301356126ff81612593565b809150509250929050565b6000806020838503121561271d57600080fd5b823567ffffffffffffffff8082111561273557600080fd5b818501915085601f83011261274957600080fd5b81358181111561275857600080fd5b86602060608302850101111561276d57600080fd5b60209290920196919550909350505050565b6000806000806080858703121561279557600080fd5b84356127a081612593565b935060208501356127b0816125cc565b925060408501356127c081612593565b915060608501356127d081612593565b939692955090935050565b600080604083850312156127ee57600080fd5b82356127f981612593565b915060208301356126ff816125cc565b6000806040838503121561281c57600080fd5b823561282781612593565b946020939093013593505050565b60008060006040848603121561284a57600080fd5b833561285581612593565b9250602084013567ffffffffffffffff8082111561287257600080fd5b818601915086601f83011261288657600080fd5b81358181111561289557600080fd5b8760208260051b85010111156128aa57600080fd5b6020830194508093505050509250925092565b6000602082840312156128cf57600080fd5b815180151581146125c557600080fd5b6000602082840312156128f157600080fd5b81516125c581612593565b60006020828403121561290e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561115557611155612915565b838152606081016129678461266c565b8360208301526129768361266c565b826040830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61ffff83168152604081016129c78361266c565b8260208301529392505050565b8181038181111561115557611155612915565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060608284031215612a5757600080fd5b6040516060810181811067ffffffffffffffff82111715612aa1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528235612aaf816125cc565b8152602083013561ffff81168114612ac657600080fd5b60208201526040830135612ad981612593565b60408201529392505050565b61ffff848116825283166020820152606081016129768361266c565b808202811582820484141761115557611155612915565b600082612b4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015612b6e578181015183820152602001612b56565b50506000910152565b60008151808452612b8f816020860160208601612b53565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b038316815260406020820152600061105e6040830184612b77565b60006001600160a01b03808616835280851660208401525060606040830152612c0f6060830184612b77565b95945050505050565b61ffff818116838216019080821115612c3357612c33612915565b5092915050565b60608101612c478561266c565b93815261ffff92909216602083015260409091015290565b60608101612c6c8561266c565b938152602081019290925260409091015290565b60008251612c92818460208701612b53565b9190910192915050565b6020815260006125c56020830184612b7756fe72656d6f7665446973747269627574696f6e436f6e66696728536368656d612c61646472657373296164644f72557064617465446973747269627574696f6e436f6e6669677328446973747269627574696f6e436f6e6669675b5d29a2646970667358221220b1db932da49f621b9742b1c134a47550b0625658dff025f09b897fba34f4d82c64736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a35760003560e01c8063893ffe98116100ee578063b4a0bdf311610097578063e30c397811610071578063e30c3978146103a0578063f2fde38b146103b1578063fa7b81a0146103c4578063fc31116a146103eb57600080fd5b8063b4a0bdf314610373578063be26317e14610384578063cd6dc6871461038d57600080fd5b8063966961f0116100c8578063966961f01461032b578063aea211211461033e578063afcff50f1461035f57600080fd5b8063893ffe98146102e05780638da5cb5b146102f35780638dd950021461030457600080fd5b80634f429f3611610150578063715018a61161012a578063715018a6146102bd57806379ba5097146102c55780637b77cd6a146102cd57600080fd5b80634f429f36146102655780635db6da12146102785780635f3d6133146102aa57600080fd5b806316faecec1161018157806316faecec146101f157806333e1567f14610204578063392ee7121461024357600080fd5b80630e32cb86146101a85780631036bbe2146101bd578063163db71b146101de575b600080fd5b6101bb6101b63660046125a8565b6103fe565b005b6101c661271081565b60405161ffff90911681526020015b60405180910390f35b610130545b6040519081526020016101d5565b6101bb6101ff3660046125d9565b610412565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d5565b610256610251366004612624565b610788565b6040516101d5939291906126a3565b6101bb6102733660046126d1565b6107c8565b6101e36102863660046125d9565b61012e60209081526000938452604080852082529284528284209052825290205481565b6101bb6102b836600461270a565b610b0a565b6101bb610e19565b6101bb610e2d565b6101bb6102db3660046125a8565b610ebd565b6101e36102ee36600461277f565b610f44565b6033546001600160a01b031661022b565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101e36103393660046127db565b611066565b6101e361034c3660046125a8565b61012f6020526000908152604090205481565b61012d5461022b906001600160a01b031681565b6097546001600160a01b031661022b565b6101e360fb5481565b6101bb61039b366004612809565b61115b565b6065546001600160a01b031661022b565b6101bb6103bf3660046125a8565b6112e6565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101bb6103f9366004612835565b61136f565b6104066113c5565b61040f8161141f565b50565b61041a611515565b826001600160a01b0316627e3dd26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906128bd565b6104b1576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104ba8261156e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614158015610593575061012d546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058891906128df565b6001600160a01b0316145b156105ca576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105d5826115ae565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038516906370a0823190602401602060405180830381865afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065c91906128fc565b6001600160a01b038516600090815261012f602052604090205490915080821115610776576001600160a01b03808716600090815261012e602090815260408083209389168352929052908120828403918291908660018111156106c2576106c261263d565b60018111156106d3576106d361263d565b815260200190815260200160002060008282546106f09190612944565b90915550506001600160a01b038616600090815261012f60205260408120805483929061071e908490612944565b92505081905550856001600160a01b0316876001600160a01b03167fa46b2431e663cf7b50c9d5129aff85d2394ecfd447b7ccba83986510a9d945ea83888860405161076c93929190612957565b60405180910390a3505b505050610783600160c955565b505050565b610130818154811061079957600080fd5b60009182526020909120015460ff81169150610100810461ffff1690630100000090046001600160a01b031683565b6107e9604051806060016040528060288152602001612cb0602891396115d9565b600080805b61013054811015610894576000610130828154811061080f5761080f612984565b6000918252602090912001805490915060ff1660018111156108335761083361263d565b8660018111156108455761084561263d565b148015610865575080546001600160a01b03868116630100000090920416145b801561087957508054610100900461ffff16155b1561088b576001925081935050610894565b506001016107ee565b508015610afc5761013082815481106108af576108af612984565b9060005260206000200160000160039054906101000a90046001600160a01b03166001600160a01b03167f70e7a210881df49522a5bf05d477e00d59e52a41c96c1eedeaeb356b9e6c81cc610130848154811061090e5761090e612984565b9060005260206000200160000160019054906101000a900461ffff16610130858154811061093e5761093e612984565b60009182526020909120015460405161095b929160ff16906129b3565b60405180910390a26101308054610974906001906129d4565b8154811061098457610984612984565b9060005260206000200161013083815481106109a2576109a2612984565b60009182526020909120825491018054909160ff169082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183818111156109ef576109ef61263d565b02179055508154815461ffff61010092839004169091027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff82168117835592546001600160a01b0363010000009182900416027fffffffffffffffffff0000000000000000000000000000000000000000ffffff9093167fffffffffffffffffff00000000000000000000000000000000000000000000ff90911617919091179055610130805480610aa357610aa36129e7565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffff00000000000000000000000000000000000000000000001690550190555b610b046116a5565b50505050565b610b12611515565b610b33604051806060016040528060348152602001612cd8603491396115d9565b60005b81811015610df5576000838383818110610b5257610b52612984565b905060600201803603810190610b689190612a45565b9050610b77816040015161156e565b61013054600090815b81811015610ca55760006101308281548110610b9e57610b9e612984565b6000918252602090912001805490915060ff166001811115610bc257610bc261263d565b85516001811115610bd557610bd561263d565b148015610bfa575060408501518154630100000090046001600160a01b039081169116145b15610c9c5760408581015182546020880151885193516001600160a01b03909316937fa682db621f4ae1c92cd6c492151d32fe657fc6db6e87bd65eb8bda05311f6ef293610c5393610100900461ffff16929190612ae5565b60405180910390a26020850151815461ffff909116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff90911617905560019250610ca5565b50600101610b80565b5081610de75761013080546001818101835560009290925284517f2f605e086faac1d93117bbfbc18835d434e9405fadc1ca66faf4b864746daf349091018054869391929183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908381811115610d2057610d2061263d565b021790555060208281015182546040948501517fffffffffffffffffff00000000000000000000000000000000000000000000ff90911661010061ffff909316929092027fffffffffffffffffff0000000000000000000000000000000000000000ffffff169190911763010000006001600160a01b03928316021790925585830151908601518651935191909216927f8c96910d818618d8b1de4e1b5672a192443e87aa553f0ebe4c47f9d8c928b28292610dde929091906129b3565b60405180910390a25b836001019350505050610b36565b50610dfe6116a5565b61013054610e0b9061187d565b610e15600160c955565b5050565b610e216113c5565b610e2b60006118c7565b565b60655433906001600160a01b03168114610eb45760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61040f816118c7565b610ec56113c5565b610ece8161156e565b61012d546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61013054600090815b8181101561105b5760006101308281548110610f6b57610f6b612984565b906000526020600020019050866001811115610f8957610f8961263d565b815460ff166001811115610f9f57610f9f61263d565b148015610fbf575080546001600160a01b03878116630100000090920416145b15611052576001600160a01b03808916600090815261012e60209081526040808320938916835292905290812081896001811115610fff57610fff61263d565b60018111156110105761101061263d565b815260208101919091526040016000205482549091506127109061103d90610100900461ffff1683612b01565b6110479190612b18565b94505050505061105e565b50600101610f4d565b50505b949350505050565b61013054600090815b81811015611152576000610130828154811061108d5761108d612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156110bc576110bc61263d565b60018111156110cd576110cd61263d565b81529054610100810461ffff166020830152630100000090046001600160a01b03908116604092830152908201519192508781169116148015611132575084600181111561111d5761111d61263d565b815160018111156111305761113061263d565b145b15611149576020015161ffff169250611155915050565b5060010161106f565b50505b92915050565b600054610100900460ff161580801561117b5750600054600160ff909116105b806111955750303b158015611195575060005460ff166001145b6112075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610eab565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561126557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61126e836118f8565b611276611986565b61127f82611a0b565b801561078357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6112ee6113c5565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556113376033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611377611515565b60005b818110156113ba576113b28484848481811061139857611398612984565b90506020020160208101906113ad91906125a8565b611ac0565b60010161137a565b50610783600160c955565b6033546001600160a01b03163314610e2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eab565b6001600160a01b03811661149b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610eab565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b600260c954036115675760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eab565b600260c955565b6001600160a01b03811661040f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008260018111156115c4576115c461263d565b036115cd575060005b919050565b600160c955565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906116259033908690600401612bc1565b602060405180830381865afa158015611642573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166691906128bd565b905080610e15573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610eab93929190612be3565b60006116b2600180612944565b905060008167ffffffffffffffff8111156116cf576116cf612a16565b6040519080825280602002602001820160405280156116f8578160200160208202803683370190505b506101305490915060005b818110156117e1576000610130828154811061172157611721612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156117505761175061263d565b60018111156117615761176161263d565b81529054610100810461ffff1660208084019190915263010000009091046001600160a01b0316604090920191909152810151815191925090859060018111156117ad576117ad61263d565b815181106117bd576117bd612984565b602002602001018181516117d19190612c18565b61ffff1690525050600101611703565b5060005b83811015610b045761271061ffff1683828151811061180657611806612984565b602002602001015161ffff161415801561183e575082818151811061182d5761182d612984565b602002602001015161ffff16600014155b15611875576040517f0b8ad7f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001016117e5565b60fb5481111561040f5760fb546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610eab565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561040f81612099565b600054610100900460ff166119755760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b61197d612103565b61040f81612188565b600054610100900460ff16611a035760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612205565b60fb548111611a825760405162461bcd60e51b815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610eab565b60fb80549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101611509565b6000611acd600180612944565b905060008167ffffffffffffffff811115611aea57611aea612a16565b604051908082528060200260200182016040528015611b13578160200160208202803683370190505b5090506000805b83811015611bdb576001600160a01b03808716600090815261012e60209081526040808320938916835292905290812090826001811115611b5d57611b5d61263d565b6001811115611b6e57611b6e61263d565b6001811115611b7f57611b7f61263d565b815260200190815260200160002054838281518110611ba057611ba0612984565b602002602001018181525050828181518110611bbe57611bbe612984565b602002602001015182611bd19190612944565b9150600101611b1a565b5080600003611beb575050505050565b60008367ffffffffffffffff811115611c0657611c06612a16565b604051908082528060200260200182016040528015611c2f578160200160208202803683370190505b50905060005b61013054811015611e645760006101308281548110611c5657611c56612984565b60009182526020909120604080516060810190915291018054829060ff166001811115611c8557611c8561263d565b6001811115611c9657611c9661263d565b81529054610100810461ffff90811660208085019190915263010000009092046001600160a01b0316604090930192909252820151825192935060009261271092919091169088906001811115611cef57611cef61263d565b81518110611cff57611cff612984565b6020026020010151611d119190612b01565b611d1b9190612b18565b9050808483600001516001811115611d3557611d3561263d565b81518110611d4557611d45612984565b60200260200101818151611d599190612944565b9052508015611e5a576040820151611d7c906001600160a01b038a169083612282565b60408083015190517faac59a750000000000000000000000000000000000000000000000000000000081526001600160a01b038b811660048301528a811660248301529091169063aac59a7590604401600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b50505050876001600160a01b031682604001516001600160a01b03167f09f71e7b22d78540ee9a42f09917a9d62f46735cb0dfa70d6bab27866d9cb5008460000151856020015185604051611e5193929190612c3a565b60405180910390a35b5050600101611c35565b5060008467ffffffffffffffff811115611e8057611e80612a16565b604051908082528060200260200182016040528015611ea9578160200160208202803683370190505b50905060005b8581101561208f57828181518110611ec957611ec9612984565b6020026020010151858281518110611ee357611ee3612984565b6020026020010151611ef591906129d4565b828281518110611f0757611f07612984565b602002602001018181525050818181518110611f2557611f25612984565b6020908102919091018101516001600160a01b03808b16600090815261012e84526040808220928c1682529190935282209091836001811115611f6a57611f6a61263d565b6001811115611f7b57611f7b61263d565b6001811115611f8c57611f8c61263d565b815260200190815260200160002081905550828181518110611fb057611fb0612984565b602002602001015161012f6000896001600160a01b03166001600160a01b0316815260200190815260200160002054611fe991906129d4565b6001600160a01b03808916600081815261012f602052604090209290925589167f7d881f3d6246a6a2b97b121b8ba093c17497912c68e8b2bca6108528e91df3ca83600181111561203c5761203c61263d565b88858151811061204e5761204e612984565b602002602001015186868151811061206857612068612984565b602002602001015160405161207f93929190612c5f565b60405180910390a3600101611eaf565b5050505050505050565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166121805760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612302565b600054610100900460ff166104065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b600054610100900460ff166115d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610783908490612388565b600054610100900460ff1661237f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b336118c7565b60006123dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124709092919063ffffffff16565b90508051600014806123fe5750808060200190518101906123fe91906128bd565b6107835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610eab565b606061105e848460008585600080866001600160a01b031685876040516124979190612c80565b60006040518083038185875af1925050503d80600081146124d4576040519150601f19603f3d011682016040523d82523d6000602084013e6124d9565b606091505b50915091506124ea878383876124f5565b979650505050505050565b6060831561256457825160000361255d576001600160a01b0385163b61255d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610eab565b508161105e565b61105e83838151156125795781518083602001fd5b8060405162461bcd60e51b8152600401610eab9190612c9c565b6001600160a01b038116811461040f57600080fd5b6000602082840312156125ba57600080fd5b81356125c581612593565b9392505050565b6002811061040f57600080fd5b6000806000606084860312156125ee57600080fd5b83356125f981612593565b9250602084013561260981612593565b91506040840135612619816125cc565b809150509250925092565b60006020828403121561263657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061040f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b606081016126b08561266c565b93815261ffff9290921660208301526001600160a01b031660409091015290565b600080604083850312156126e457600080fd5b82356126ef816125cc565b915060208301356126ff81612593565b809150509250929050565b6000806020838503121561271d57600080fd5b823567ffffffffffffffff8082111561273557600080fd5b818501915085601f83011261274957600080fd5b81358181111561275857600080fd5b86602060608302850101111561276d57600080fd5b60209290920196919550909350505050565b6000806000806080858703121561279557600080fd5b84356127a081612593565b935060208501356127b0816125cc565b925060408501356127c081612593565b915060608501356127d081612593565b939692955090935050565b600080604083850312156127ee57600080fd5b82356127f981612593565b915060208301356126ff816125cc565b6000806040838503121561281c57600080fd5b823561282781612593565b946020939093013593505050565b60008060006040848603121561284a57600080fd5b833561285581612593565b9250602084013567ffffffffffffffff8082111561287257600080fd5b818601915086601f83011261288657600080fd5b81358181111561289557600080fd5b8760208260051b85010111156128aa57600080fd5b6020830194508093505050509250925092565b6000602082840312156128cf57600080fd5b815180151581146125c557600080fd5b6000602082840312156128f157600080fd5b81516125c581612593565b60006020828403121561290e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561115557611155612915565b838152606081016129678461266c565b8360208301526129768361266c565b826040830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61ffff83168152604081016129c78361266c565b8260208301529392505050565b8181038181111561115557611155612915565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060608284031215612a5757600080fd5b6040516060810181811067ffffffffffffffff82111715612aa1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528235612aaf816125cc565b8152602083013561ffff81168114612ac657600080fd5b60208201526040830135612ad981612593565b60408201529392505050565b61ffff848116825283166020820152606081016129768361266c565b808202811582820484141761115557611155612915565b600082612b4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015612b6e578181015183820152602001612b56565b50506000910152565b60008151808452612b8f816020860160208601612b53565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b038316815260406020820152600061105e6040830184612b77565b60006001600160a01b03808616835280851660208401525060606040830152612c0f6060830184612b77565b95945050505050565b61ffff818116838216019080821115612c3357612c33612915565b5092915050565b60608101612c478561266c565b93815261ffff92909216602083015260409091015290565b60608101612c6c8561266c565b938152602081019290925260409091015290565b60008251612c92818460208701612b53565b9190910192915050565b6020815260006125c56020830184612b7756fe72656d6f7665446973747269627574696f6e436f6e66696728536368656d612c61646472657373296164644f72557064617465446973747269627574696f6e436f6e6669677328446973747269627574696f6e436f6e6669675b5d29a2646970667358221220b1db932da49f621b9742b1c134a47550b0625658dff025f09b897fba34f4d82c64736f6c63430008190033", + "devdoc": { + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "addOrUpdateDistributionConfigs((uint8,uint16,address)[])": { + "details": "Add or update destination targets based on destination address", + "params": { + "configs": "configurations of the destinations." + } + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor" + }, + "getPercentageDistribution(address,uint8)": { + "details": "Used to find out the percentage distribution for a particular destination based on schema", + "params": { + "destination": "the destination address of the distribution target", + "schema": "the schema of the distribution target" + }, + "returns": { + "_0": "percentage percentage distribution" + } + }, + "getUnreleasedFunds(address,uint8,address,address)": { + "details": "Used to find out the amount of funds that's going to be released when release funds is called.", + "params": { + "asset": "the asset address which will be released", + "comptroller": "the comptroller address of the pool", + "destination": "the destination address of the distribution target", + "schema": "the schema of the distribution target" + } + }, + "initialize(address,uint256)": { + "details": "Initializes the deployer to owner.", + "params": { + "_accessControlManager": "The address of ACM contract", + "_loopsLimit": "Limit for the loops in the contract to avoid DOS" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "releaseFunds(address,address[])": { + "details": "Release funds", + "params": { + "assets": "assets to be released to distribution targets", + "comptroller": "the comptroller address of the pool" + } + }, + "removeDistributionConfig(uint8,address)": { + "details": "Remove destionation target if percentage is 0", + "params": { + "destination": "destination address of the configuration", + "schema": "schema of the configuration" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setPoolRegistry(address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when pool registry address is zero", + "details": "Pool registry setter.", + "params": { + "_poolRegistry": "Address of the pool registry" + } + }, + "totalDistributions()": { + "details": "Returns the total number of distribution targets" + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + }, + "updateAssetsState(address,address,uint8)": { + "details": "Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.", + "params": { + "asset": "Asset address.", + "comptroller": "Comptroller address (pool)", + "incomeType": "type of income" + } + } + }, + "stateVariables": { + "CORE_POOL_COMPTROLLER": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + }, + "WBNB": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + }, + "vBNB": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + } + }, + "version": 1 + }, + "userdoc": { + "errors": { + "MaxLoopsLimitExceeded(uint256,uint256)": [ + { + "notice": "Thrown an error on maxLoopsLimit exceeds for any loop" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ] + }, + "events": { + "AssetReleased(address,address,uint8,uint256,uint256)": { + "notice": "Event emitted when an asset is released to a target" + }, + "AssetsReservesUpdated(address,address,uint256,uint8,uint8)": { + "notice": "Event emitted after updating of the assets reserves." + }, + "DistributionConfigAdded(address,uint16,uint8)": { + "notice": "Event emitted when distribution configuration is added" + }, + "DistributionConfigRemoved(address,uint16,uint8)": { + "notice": "Event emitted when distribution configuration is removed" + }, + "DistributionConfigUpdated(address,uint16,uint16,uint8)": { + "notice": "Event emitted when distribution configuration is updated" + }, + "MaxLoopsLimitUpdated(uint256,uint256)": { + "notice": "Emitted when max loops limit is set" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + }, + "PoolRegistryUpdated(address,address)": { + "notice": "Emitted when pool registry address is updated" + }, + "ReservesUpdated(address,address,uint8,uint256,uint256)": { + "notice": "Event emitted when asset reserves state is updated" + } + }, + "kind": "user", + "methods": { + "CORE_POOL_COMPTROLLER()": { + "notice": "address of core pool comptroller contract" + }, + "WBNB()": { + "notice": "address of WBNB contract" + }, + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "assetsReserves(address,address,uint8)": { + "notice": "comptroller => asset => schema => balance" + }, + "distributionTargets(uint256)": { + "notice": "configuration for different income distribution targets" + }, + "poolRegistry()": { + "notice": "address of pool registry contract" + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "totalAssetReserve(address)": { + "notice": "asset => balance" + }, + "vBNB()": { + "notice": "address of vBNB contract" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 547, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_status", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 616, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 6563, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "maxLoopsLimit", + "offset": 0, + "slot": "251", + "type": "t_uint256" + }, + { + "astId": 6568, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 6964, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "poolRegistry", + "offset": 0, + "slot": "301", + "type": "t_address" + }, + { + "astId": 6977, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "assetsReserves", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_address,t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256)))" + }, + { + "astId": 6982, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "totalAssetReserve", + "offset": 0, + "slot": "303", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 6987, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "distributionTargets", + "offset": 0, + "slot": "304", + "type": "t_array(t_struct(DistributionConfig)6952_storage)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DistributionConfig)6952_storage)dyn_storage": { + "base": "t_struct(DistributionConfig)6952_storage", + "encoding": "dynamic_array", + "label": "struct ProtocolShareReserve.DistributionConfig[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_enum(Schema)6943": { + "encoding": "inplace", + "label": "enum ProtocolShareReserve.Schema", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256)))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => mapping(enum ProtocolShareReserve.Schema => uint256)))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256))" + }, + "t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(enum ProtocolShareReserve.Schema => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_enum(Schema)6943,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_enum(Schema)6943,t_uint256)": { + "encoding": "mapping", + "key": "t_enum(Schema)6943", + "label": "mapping(enum ProtocolShareReserve.Schema => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DistributionConfig)6952_storage": { + "encoding": "inplace", + "label": "struct ProtocolShareReserve.DistributionConfig", + "members": [ + { + "astId": 6946, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "schema", + "offset": 0, + "slot": "0", + "type": "t_enum(Schema)6943" + }, + { + "astId": 6949, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "percentage", + "offset": 1, + "slot": "0", + "type": "t_uint16" + }, + { + "astId": 6951, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "destination", + "offset": 3, + "slot": "0", + "type": "t_address" + } + ], + "numberOfBytes": "32" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/basesepolia/ProtocolShareReserve_Proxy.json b/deployments/basesepolia/ProtocolShareReserve_Proxy.json new file mode 100644 index 00000000..ae5d29cf --- /dev/null +++ b/deployments/basesepolia/ProtocolShareReserve_Proxy.json @@ -0,0 +1,272 @@ +{ + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "receipt": { + "to": null, + "from": "0x646413D07084c4C9B07C023a2207ad0b5292094d", + "contractAddress": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "transactionIndex": 6, + "gasUsed": "734344", + "logsBloom": "0x00000000000000000000020000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000001002000001000000000000800000000000000000000000020000000001000000000800000000800000000020040000000000400000000000000000000000000000000000000000000080000000000000800000000000000000000000002000000400000000000000800000000080000000000000000020000000000000000001040000000000000400000000010000000020000020000200000000000000000000000000000800000000000000000000000000", + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f", + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "logs": [ + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000de1fc9e003c2637e94da29d55783ce42f1e1f81c" + ], + "data": "0x", + "logIndex": 11, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000646413d07084c4c9b07c023a2207ad0b5292094d" + ], + "data": "0x", + "logIndex": 12, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000724138223d8f76b519fde715f60124e7ce51e051", + "logIndex": 13, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 14, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 15, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + }, + { + "transactionIndex": 6, + "blockNumber": 17905507, + "transactionHash": "0xb2a8b8fc52fa108301a65302c17caa42e3f90180b56ac4f834d86f1ccfb6c9a9", + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b85dd19112c4bf1240fed0f26e8d0b0576a82546", + "logIndex": 16, + "blockHash": "0xa2a8ac81fd872f5996b15fc29004831150937b60993dc10314cd275bbd8d8d0f" + } + ], + "blockNumber": 17905507, + "cumulativeGasUsed": "4937924", + "status": 1, + "byzantium": true + }, + "args": [ + "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "0xcd6dc687000000000000000000000000724138223d8f76b519fde715f60124e7ce51e0510000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is upgraded.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol\":\"OptimizedTransparentUpgradeableProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"hardhat-deploy/solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\\n address internal immutable _ADMIN;\\n\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _ADMIN = admin_;\\n\\n // still store it to work with EIP-1967\\n bytes32 slot = _ADMIN_SLOT;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n sstore(slot, admin_)\\n }\\n emit AdminChanged(address(0), admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n\\n function _getAdmin() internal view virtual override returns (address) {\\n return _ADMIN;\\n }\\n}\\n\",\"keccak256\":\"0xa30117644e27fa5b49e162aae2f62b36c1aca02f801b8c594d46e2024963a534\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a0604052604051610ea3380380610ea3833981016040819052610022916103d2565b828161004f60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6104a2565b600080516020610e5c8339815191521461006b5761006b6104c3565b61007782826000610128565b506100a5905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61046104a2565b600080516020610e3c833981519152146100c1576100c16104c3565b6001600160a01b0382166080819052600080516020610e3c8339815191528381556040805160008152602081019390935290917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a150505050610528565b61013183610154565b60008251118061013e5750805b1561014f5761014d8383610194565b505b505050565b61015d816101c2565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606101b98383604051806060016040528060278152602001610e7c60279139610263565b90505b92915050565b6001600160a01b0381163b6102345760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b600080516020610e5c83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60606001600160a01b0384163b6102cb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b606482015260840161022b565b600080856001600160a01b0316856040516102e691906104d9565b600060405180830381855af49150503d8060008114610321576040519150601f19603f3d011682016040523d82523d6000602084013e610326565b606091505b509092509050610337828286610343565b925050505b9392505050565b6060831561035257508161033c565b8251156103625782518084602001fd5b8160405162461bcd60e51b815260040161022b91906104f5565b80516001600160a01b038116811461039357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103c95781810151838201526020016103b1565b50506000910152565b6000806000606084860312156103e757600080fd5b6103f08461037c565b92506103fe6020850161037c565b60408501519092506001600160401b038082111561041b57600080fd5b818601915086601f83011261042f57600080fd5b81518181111561044157610441610398565b604051601f8201601f19908116603f0116810190838211818310171561046957610469610398565b8160405282815289602084870101111561048257600080fd5b6104938360208301602088016103ae565b80955050505050509250925092565b818103818111156101bc57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052600160045260246000fd5b600082516104eb8184602087016103ae565b9190910192915050565b60208152600082518060208401526105148160408501602087016103ae565b601f01601f19169190910160400192915050565b6080516108d76105656000396000818160fc0152818161015f015281816101ee015281816102450152818161028301526102a701526108d76000f3fe6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100cb57610052565b36610052576100506100e0565b005b6100506100e0565b34801561006657600080fd5b5061005061007536600461074b565b6100fa565b610050610088366004610766565b61015d565b34801561009957600080fd5b506100a26101ea565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d757600080fd5b506100a2610241565b6100e86102a5565b6100f86100f3610395565b6103d5565b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361015557610152816040518060200160405280600081525060006103f9565b50565b6101526100e0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036101e2576101dd8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103f9915050565b505050565b6101dd6100e0565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657610231610395565b905090565b61023e6100e0565b90565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657507f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036100f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b3660008037600080366000845af43d6000803e8080156103f4573d6000f35b3d6000fd5b61040283610424565b60008251118061040f5750805b156101dd5761041e8383610471565b50505050565b61042d8161049d565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610496838360405180606001604052806027815260200161087b602791396105a7565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81163b610541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161038c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606073ffffffffffffffffffffffffffffffffffffffff84163b61064d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161038c565b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051610675919061080d565b600060405180830381855af49150503d80600081146106b0576040519150601f19603f3d011682016040523d82523d6000602084013e6106b5565b606091505b50915091506106c58282866106cf565b9695505050505050565b606083156106de575081610496565b8251156106ee5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038c9190610829565b803573ffffffffffffffffffffffffffffffffffffffff8116811461074657600080fd5b919050565b60006020828403121561075d57600080fd5b61049682610722565b60008060006040848603121561077b57600080fd5b61078484610722565b9250602084013567ffffffffffffffff808211156107a157600080fd5b818601915086601f8301126107b557600080fd5b8135818111156107c457600080fd5b8760208285010111156107d657600080fd5b6020830194508093505050509250925092565b60005b838110156108045781810151838201526020016107ec565b50506000910152565b6000825161081f8184602087016107e9565b9190910192915050565b60208152600082518060208401526108488160408501602087016107e9565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200136fd34dfdb0d97935b77a84c836b17bf901cefa29ed5b1ef847b08c6cba8d064736f6c63430008190033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x6080604052600436106100435760003560e01c80633659cfe61461005a5780634f1ef2861461007a5780635c60da1b1461008d578063f851a440146100cb57610052565b36610052576100506100e0565b005b6100506100e0565b34801561006657600080fd5b5061005061007536600461074b565b6100fa565b610050610088366004610766565b61015d565b34801561009957600080fd5b506100a26101ea565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100d757600080fd5b506100a2610241565b6100e86102a5565b6100f86100f3610395565b6103d5565b565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361015557610152816040518060200160405280600081525060006103f9565b50565b6101526100e0565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036101e2576101dd8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506103f9915050565b505050565b6101dd6100e0565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657610231610395565b905090565b61023e6100e0565b90565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16330361023657507f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1633036100f8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b60006102317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b3660008037600080366000845af43d6000803e8080156103f4573d6000f35b3d6000fd5b61040283610424565b60008251118061040f5750805b156101dd5761041e8383610471565b50505050565b61042d8161049d565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610496838360405180606001604052806027815260200161087b602791396105a7565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81163b610541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161038c565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b606073ffffffffffffffffffffffffffffffffffffffff84163b61064d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161038c565b6000808573ffffffffffffffffffffffffffffffffffffffff1685604051610675919061080d565b600060405180830381855af49150503d80600081146106b0576040519150601f19603f3d011682016040523d82523d6000602084013e6106b5565b606091505b50915091506106c58282866106cf565b9695505050505050565b606083156106de575081610496565b8251156106ee5782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038c9190610829565b803573ffffffffffffffffffffffffffffffffffffffff8116811461074657600080fd5b919050565b60006020828403121561075d57600080fd5b61049682610722565b60008060006040848603121561077b57600080fd5b61078484610722565b9250602084013567ffffffffffffffff808211156107a157600080fd5b818601915086601f8301126107b557600080fd5b8135818111156107c457600080fd5b8760208285010111156107d657600080fd5b6020830194508093505050509250925092565b60005b838110156108045781810151838201526020016107ec565b50506000910152565b6000825161081f8184602087016107e9565b9190910192915050565b60208152600082518060208401526108488160408501602087016107e9565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200136fd34dfdb0d97935b77a84c836b17bf901cefa29ed5b1ef847b08c6cba8d064736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is upgraded." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/basesepolia/solcInputs/027aeec938943227f90cf24126ba2c44.json b/deployments/basesepolia/solcInputs/027aeec938943227f90cf24126ba2c44.json new file mode 100644 index 00000000..0a7015ab --- /dev/null +++ b/deployments/basesepolia/solcInputs/027aeec938943227f90cf24126ba2c44.json @@ -0,0 +1,280 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\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" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\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 cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1967.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/IERC1967.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(ITransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(ITransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n ITransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(address) external;\n\n function upgradeTo(address) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) {\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n revert(\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return \"\";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() private {\n require(msg.value == 0);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@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" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^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 // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\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(uint256 x, uint256 y, uint256 denominator, Rounding rounding) 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 // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `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 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.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 `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n 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 /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface VBep20Interface is IERC20Metadata {\n /**\n * @notice Underlying asset for this VToken\n */\n function underlying() external view returns (address);\n}\n" + }, + "@venusprotocol/oracle/contracts/ResilientOracle.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\n// SPDX-FileCopyrightText: 2022 Venus\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"./interfaces/VBep20Interface.sol\";\nimport \"./interfaces/OracleInterface.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\n\n/**\n * @title ResilientOracle\n * @author Venus\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\n * \n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\n * for attacking the protocol.\n * \n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\n * \n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \n * \n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\n * market. The upper bound ratio represents the deviation between reported price (the price that’s being\n * validated) and the anchor price (the price we are validating against) above which the reported price will\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\n * should be true:\n\n```\nanchorRatio = anchorPrice/reporterPrice\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\n```\n\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \n * \n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\n * oracle to be stagnant and treat it like it's disabled.\n */\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\n /**\n * @dev Oracle roles:\n * **main**: The most trustworthy price source\n * **pivot**: Price oracle used as a loose sanity checker\n * **fallback**: The backup source when main oracle price is invalidated\n */\n enum OracleRole {\n MAIN,\n PIVOT,\n FALLBACK\n }\n\n struct TokenConfig {\n /// @notice asset address\n address asset;\n /// @notice `oracles` stores the oracles based on their role in the following order:\n /// [main, pivot, fallback],\n /// It can be indexed with the corresponding enum OracleRole value\n address[3] oracles;\n /// @notice `enableFlagsForOracles` stores the enabled state\n /// for each oracle in the same order as `oracles`\n bool[3] enableFlagsForOracles;\n }\n\n uint256 public constant INVALID_PRICE = 0;\n\n /// @notice Native market address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable nativeMarket;\n\n /// @notice VAI address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vai;\n\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\n /// and can serve as any underlying asset of a market that supports native tokens\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\n\n /// @notice Bound validator contract address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n BoundValidatorInterface public immutable boundValidator;\n\n mapping(address => TokenConfig) private tokenConfigs;\n\n event TokenConfigAdded(\n address indexed asset,\n address indexed mainOracle,\n address indexed pivotOracle,\n address fallbackOracle\n );\n\n /// Event emitted when an oracle is set\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\n\n /// Event emitted when an oracle is enabled or disabled\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\n\n /**\n * @notice Checks whether an address is null or not\n */\n modifier notNullAddress(address someone) {\n if (someone == address(0)) revert(\"can't be zero address\");\n _;\n }\n\n /**\n * @notice Checks whether token config exists by checking whether asset is null address\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\n * @param asset asset address\n */\n modifier checkTokenConfigExistence(address asset) {\n if (tokenConfigs[asset].asset == address(0)) revert(\"token config must exist\");\n _;\n }\n\n /// @notice Constructor for the implementation contract. Sets immutable variables.\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\n /// (e.g vETH on ethereum would not be supported, only vWETH)\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\n /// Set to address(0) of VAI is not existent.\n /// @param _boundValidator Address of the bound validator contract\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address nativeMarketAddress,\n address vaiAddress,\n BoundValidatorInterface _boundValidator\n ) notNullAddress(address(_boundValidator)) {\n nativeMarket = nativeMarketAddress;\n vai = vaiAddress;\n boundValidator = _boundValidator;\n\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract admin and sets the BoundValidator contract address\n * @param accessControlManager_ Address of the access control manager contract\n */\n function initialize(address accessControlManager_) external initializer {\n __AccessControlled_init(accessControlManager_);\n __Pausable_init();\n }\n\n /**\n * @notice Pauses oracle\n * @custom:access Only Governance\n */\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n _pause();\n }\n\n /**\n * @notice Unpauses oracle\n * @custom:access Only Governance\n */\n function unpause() external {\n _checkAccessAllowed(\"unpause()\");\n _unpause();\n }\n\n /**\n * @notice Batch sets token configs\n * @param tokenConfigs_ Token config array\n * @custom:access Only Governance\n * @custom:error Throws a length error if the length of the token configs array is 0\n */\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\n if (tokenConfigs_.length == 0) revert(\"length can't be 0\");\n uint256 numTokenConfigs = tokenConfigs_.length;\n for (uint256 i; i < numTokenConfigs; ) {\n setTokenConfig(tokenConfigs_[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @notice Sets oracle for a given asset and role.\n * @dev Supplied asset **must** exist and main oracle may not be null\n * @param asset Asset address\n * @param oracle Oracle address\n * @param role Oracle role\n * @custom:access Only Governance\n * @custom:error Null address error if main-role oracle address is null\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\n */\n function setOracle(\n address asset,\n address oracle,\n OracleRole role\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"setOracle(address,address,uint8)\");\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\"can't set zero address to main oracle\");\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\n emit OracleSet(asset, oracle, uint256(role));\n }\n\n /**\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\n * @param asset Asset address\n * @param role Oracle role\n * @param enable Enabled boolean of the oracle\n * @custom:access Only Governance\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n */\n function enableOracle(\n address asset,\n OracleRole role,\n bool enable\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"enableOracle(address,uint8,bool)\");\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\n emit OracleEnabled(asset, uint256(role), enable);\n }\n\n /**\n * @notice Updates the TWAP pivot oracle price.\n * @dev This function should always be called before calling getUnderlyingPrice\n * @param vToken vToken address\n */\n function updatePrice(address vToken) external override {\n address asset = _getUnderlyingAsset(vToken);\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @notice Updates the pivot oracle price. Currently using TWAP\n * @dev This function should always be called before calling getPrice\n * @param asset asset address\n */\n function updateAssetPrice(address asset) external {\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @dev Gets token config by asset address\n * @param asset asset address\n * @return tokenConfig Config for the asset\n */\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\n return tokenConfigs[asset];\n }\n\n /**\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\n * - Check if the oracle is paused globally\n * - Validate price from main oracle against pivot oracle\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\n * - Validate price from main oracle against fallback oracle if the second validation failed\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\n * main oracle price is returned.\n * @param vToken vToken address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n\n address asset = _getUnderlyingAsset(vToken);\n return _getPrice(asset);\n }\n\n /**\n * @notice Gets price of the asset\n * @param asset asset address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getPrice(address asset) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n return _getPrice(asset);\n }\n\n /**\n * @notice Sets/resets single token configs.\n * @dev main oracle **must not** be a null address\n * @param tokenConfig Token config struct\n * @custom:access Only Governance\n * @custom:error NotNullAddress is thrown if asset address is null\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\n */\n function setTokenConfig(\n TokenConfig memory tokenConfig\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\n _checkAccessAllowed(\"setTokenConfig(TokenConfig)\");\n\n tokenConfigs[tokenConfig.asset] = tokenConfig;\n emit TokenConfigAdded(\n tokenConfig.asset,\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\n );\n }\n\n /**\n * @notice Gets oracle and enabled status by asset address\n * @param asset asset address\n * @param role Oracle role\n * @return oracle Oracle address based on role\n * @return enabled Enabled flag of the oracle based on token config\n */\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\n oracle = tokenConfigs[asset].oracles[uint256(role)];\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\n }\n\n function _getPrice(address asset) internal view returns (uint256) {\n uint256 pivotPrice = INVALID_PRICE;\n\n // Get pivot oracle price, Invalid price if not available or error\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracleEnabled && pivotOracle != address(0)) {\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\n pivotPrice = pricePivot;\n } catch {}\n }\n\n // Compare main price and pivot price, return main price and if validation was successful\n // note: In case pivot oracle is not available but main price is available and\n // validation is successful, the main oracle price is returned.\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\n asset,\n pivotPrice,\n pivotOracleEnabled && pivotOracle != address(0)\n );\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\n\n // Compare fallback and pivot if main oracle comparision fails with pivot\n // Return fallback price when fallback price is validated successfully with pivot oracle\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\n\n // Lastly compare main price and fallback price\n if (\n mainPrice != INVALID_PRICE &&\n fallbackPrice != INVALID_PRICE &&\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\n ) {\n return mainPrice;\n }\n\n revert(\"invalid resilient oracle price\");\n }\n\n /**\n * @notice Gets a price for the provided asset\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\n * able to fetch a correct price\n * @param asset asset address\n * @param pivotPrice Pivot oracle price\n * @param pivotEnabled If pivot oracle is not empty and enabled\n * @return price USD price in scaled decimals\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\n * @return pivotValidated Boolean representing if the validation of main oracle price\n * and pivot oracle price were successful\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\n * address is null\n */\n function _getMainOraclePrice(\n address asset,\n uint256 pivotPrice,\n bool pivotEnabled\n ) internal view returns (uint256, bool) {\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\n if (mainOracleEnabled && mainOracle != address(0)) {\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\n if (!pivotEnabled) {\n return (mainOraclePrice, true);\n }\n if (pivotPrice == INVALID_PRICE) {\n return (mainOraclePrice, false);\n }\n return (\n mainOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\n * @param asset asset address\n * @return price USD price in 18 decimals\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\n * and pivot oracle price were successfull\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\n * address is null\n */\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\n if (fallbackEnabled && fallbackOracle != address(0)) {\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\n if (pivotPrice == INVALID_PRICE) {\n return (fallbackOraclePrice, false);\n }\n return (\n fallbackOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function returns the underlying asset of a vToken\n * @param vToken vToken address\n * @return asset underlying asset address\n */\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\n if (vToken == nativeMarket) {\n asset = NATIVE_TOKEN_ADDR;\n } else if (vToken == vai) {\n asset = vai;\n } else {\n asset = VBep20Interface(vToken).underlying();\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/constants.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\nuint256 constant EXP_SCALE = 1e18;\n\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\nuint256 constant MANTISSA_ONE = EXP_SCALE;\n\n/// @dev The approximate number of seconds per year\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\n" + }, + "@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/**\n * @title MaxLoopsLimitHelper\n * @author Venus\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\n */\nabstract contract MaxLoopsLimitHelper {\n // Limit for the loops to avoid the DOS\n uint256 public maxLoopsLimit;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when max loops limit is set\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\n\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n */\n function _setMaxLoopsLimit(uint256 limit) internal {\n require(limit > maxLoopsLimit, \"Comptroller: Invalid maxLoopsLimit\");\n\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\n maxLoopsLimit = limit;\n\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\n }\n\n /**\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\n * @param len Length of the loops iterate\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\n */\n function _ensureMaxLoops(uint256 len) internal view {\n if (len > maxLoopsLimit) {\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/validators.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\nerror ZeroAddressNotAllowed();\n\n/// @notice Thrown if the supplied value is 0 where it is not allowed\nerror ZeroValueNotAllowed();\n\n/// @notice Checks if the provided address is nonzero, reverts otherwise\n/// @param address_ Address to check\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\nfunction ensureNonzeroAddress(address address_) pure {\n if (address_ == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n}\n\n/// @notice Checks if the provided value is nonzero, reverts otherwise\n/// @param value_ Value to check\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\nfunction ensureNonzeroValue(uint256 value_) pure {\n if (value_ == 0) {\n revert ZeroValueNotAllowed();\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport 'hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol';\n" + }, + "contracts/hardhat-dependency-compiler/hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport 'hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol';\n" + }, + "contracts/Interfaces/IComptroller.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IComptroller {\n function isComptroller() external view returns (bool);\n\n function markets(address) external view returns (bool);\n\n function getAllMarkets() external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { IAbstractTokenConverter } from \"../TokenConverter/IAbstractTokenConverter.sol\";\n\n/**\n * @title IConverterNetwork\n * @author Venus\n * @notice Interface implemented by `ConverterNetwork`.\n */\ninterface IConverterNetwork {\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\n\n /// @notice This function checks for given address is converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return boolean true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool);\n}\n" + }, + "contracts/Interfaces/IIncomeDestination.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IIncomeDestination {\n function updateAssetsState(address comptroller, address asset) external;\n}\n" + }, + "contracts/Interfaces/IPoolRegistry.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IPoolRegistry {\n /// @notice Get VToken in the Pool for an Asset\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\n\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IProtocolShareReserve {\n /// @notice it represents the type of vToken income\n enum IncomeType {\n SPREAD,\n LIQUIDATION\n }\n\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) external;\n}\n" + }, + "contracts/Interfaces/IRiskFund.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IRiskFund\n * @author Venus\n * @notice Interface implemented by `RiskFund`.\n */\ninterface IRiskFund {\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\n\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) external;\n\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\n}\n\n/**\n * @title IRiskFundGetters\n * @author Venus\n * @notice Interface implemented by `RiskFund` for getter methods.\n */\ninterface IRiskFundGetters {\n function convertibleBaseAsset() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IRiskFundConverter {\n function updateAssetsState(address comptroller, address asset) external;\n\n function getPools(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IShortfall.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IShortfall\n * @author Venus\n * @notice Interface implemented by `Shortfall`.\n */\ninterface IShortfall {\n function convertibleBaseAsset() external returns (address);\n}\n" + }, + "contracts/Interfaces/IVToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IVToken {\n function underlying() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IXVSVault.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @title IXVSVaultProxy\n/// @author Venus\n/// @notice Interface implemented by `XVSVault`.\ninterface IXVSVault {\n function xvsStore() external view returns (address);\n}\n" + }, + "contracts/ProtocolReserve/ProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable, IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IProtocolShareReserve } from \"../Interfaces/IProtocolShareReserve.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\nimport { IIncomeDestination } from \"../Interfaces/IIncomeDestination.sol\";\n\nerror InvalidAddress();\nerror UnsupportedAsset();\nerror InvalidTotalPercentage();\nerror InvalidMaxLoopsLimit();\n\ncontract ProtocolShareReserve is\n AccessControlledV8,\n ReentrancyGuardUpgradeable,\n MaxLoopsLimitHelper,\n IProtocolShareReserve\n{\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice protocol income is categorized into two schemas.\n /// The first schema is for spread income\n /// The second schema is for liquidation income\n enum Schema {\n PROTOCOL_RESERVES,\n ADDITIONAL_REVENUE\n }\n\n struct DistributionConfig {\n Schema schema;\n /// @dev percenatge is represented without any scale\n uint16 percentage;\n address destination;\n }\n\n /// @notice address of core pool comptroller contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n /// @notice address of WBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable WBNB;\n\n /// @notice address of vBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vBNB;\n\n /// @notice address of pool registry contract\n address public poolRegistry;\n\n uint16 public constant MAX_PERCENT = 1e4;\n\n /// @notice comptroller => asset => schema => balance\n mapping(address => mapping(address => mapping(Schema => uint256))) public assetsReserves;\n\n /// @notice asset => balance\n mapping(address => uint256) public totalAssetReserve;\n\n /// @notice configuration for different income distribution targets\n DistributionConfig[] public distributionTargets;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Event emitted after updating of the assets reserves.\n event AssetsReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n uint256 amount,\n IncomeType incomeType,\n Schema schema\n );\n\n /// @notice Event emitted when an asset is released to a target\n event AssetReleased(\n address indexed destination,\n address indexed asset,\n Schema schema,\n uint256 percent,\n uint256 amount\n );\n\n /// @notice Event emitted when asset reserves state is updated\n event ReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n Schema schema,\n uint256 oldBalance,\n uint256 newBalance\n );\n\n /// @notice Event emitted when distribution configuration is updated\n event DistributionConfigUpdated(\n address indexed destination,\n uint16 oldPercentage,\n uint16 newPercentage,\n Schema schema\n );\n\n /// @notice Event emitted when distribution configuration is added\n event DistributionConfigAdded(address indexed destination, uint16 percentage, Schema schema);\n\n /// @notice Event emitted when distribution configuration is removed\n event DistributionConfigRemoved(address indexed destination, uint16 percentage, Schema schema);\n\n /**\n * @dev Constructor to initialize the immutable variables\n * @param _corePoolComptroller The address of core pool comptroller\n * @param _wbnb The address of WBNB\n * @param _vbnb The address of vBNB\n */\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address _corePoolComptroller,\n address _wbnb,\n address _vbnb\n ) {\n ensureNonzeroAddress(_corePoolComptroller);\n ensureNonzeroAddress(_wbnb);\n ensureNonzeroAddress(_vbnb);\n\n CORE_POOL_COMPTROLLER = _corePoolComptroller;\n WBNB = _wbnb;\n vBNB = _vbnb;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /**\n * @dev Initializes the deployer to owner.\n * @param _accessControlManager The address of ACM contract\n * @param _loopsLimit Limit for the loops in the contract to avoid DOS\n */\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n __AccessControlled_init(_accessControlManager);\n __ReentrancyGuard_init();\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @dev Pool registry setter.\n * @param _poolRegistry Address of the pool registry\n * @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n */\n function setPoolRegistry(address _poolRegistry) external onlyOwner {\n ensureNonzeroAddress(_poolRegistry);\n emit PoolRegistryUpdated(poolRegistry, _poolRegistry);\n poolRegistry = _poolRegistry;\n }\n\n /**\n * @dev Add or update destination targets based on destination address\n * @param configs configurations of the destinations.\n */\n function addOrUpdateDistributionConfigs(DistributionConfig[] calldata configs) external nonReentrant {\n _checkAccessAllowed(\"addOrUpdateDistributionConfigs(DistributionConfig[])\");\n\n for (uint256 i = 0; i < configs.length; ) {\n DistributionConfig memory _config = configs[i];\n ensureNonzeroAddress(_config.destination);\n\n bool updated = false;\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 j = 0; j < distributionTargetsLength; ) {\n DistributionConfig storage config = distributionTargets[j];\n\n if (_config.schema == config.schema && config.destination == _config.destination) {\n emit DistributionConfigUpdated(\n _config.destination,\n config.percentage,\n _config.percentage,\n _config.schema\n );\n config.percentage = _config.percentage;\n updated = true;\n break;\n }\n\n unchecked {\n ++j;\n }\n }\n\n if (!updated) {\n distributionTargets.push(_config);\n emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);\n }\n\n unchecked {\n ++i;\n }\n }\n\n _ensurePercentages();\n _ensureMaxLoops(distributionTargets.length);\n }\n\n /**\n * @dev Remove destionation target if percentage is 0\n * @param schema schema of the configuration\n * @param destination destination address of the configuration\n */\n function removeDistributionConfig(Schema schema, address destination) external {\n _checkAccessAllowed(\"removeDistributionConfig(Schema,address)\");\n\n uint256 distributionIndex;\n bool found = false;\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig storage config = distributionTargets[i];\n\n if (schema == config.schema && destination == config.destination && config.percentage == 0) {\n found = true;\n distributionIndex = i;\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n\n if (found) {\n emit DistributionConfigRemoved(\n distributionTargets[distributionIndex].destination,\n distributionTargets[distributionIndex].percentage,\n distributionTargets[distributionIndex].schema\n );\n\n distributionTargets[distributionIndex] = distributionTargets[distributionTargets.length - 1];\n distributionTargets.pop();\n }\n\n _ensurePercentages();\n }\n\n /**\n * @dev Release funds\n * @param comptroller the comptroller address of the pool\n * @param assets assets to be released to distribution targets\n */\n function releaseFunds(address comptroller, address[] calldata assets) external nonReentrant {\n for (uint256 i = 0; i < assets.length; ) {\n _releaseFund(comptroller, assets[i]);\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Used to find out the amount of funds that's going to be released when release funds is called.\n * @param comptroller the comptroller address of the pool\n * @param schema the schema of the distribution target\n * @param destination the destination address of the distribution target\n * @param asset the asset address which will be released\n */\n function getUnreleasedFunds(\n address comptroller,\n Schema schema,\n address destination,\n address asset\n ) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig storage _config = distributionTargets[i];\n if (_config.schema == schema && _config.destination == destination) {\n uint256 total = assetsReserves[comptroller][asset][schema];\n return (total * _config.percentage) / MAX_PERCENT;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Returns the total number of distribution targets\n */\n function totalDistributions() external view returns (uint256) {\n return distributionTargets.length;\n }\n\n /**\n * @dev Used to find out the percentage distribution for a particular destination based on schema\n * @param destination the destination address of the distribution target\n * @param schema the schema of the distribution target\n * @return percentage percentage distribution\n */\n function getPercentageDistribution(address destination, Schema schema) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n\n if (config.destination == destination && config.schema == schema) {\n return config.percentage;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\n * @param comptroller Comptroller address (pool)\n * @param asset Asset address.\n * @param incomeType type of income\n */\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) public override(IProtocolShareReserve) nonReentrant {\n if (!IComptroller(comptroller).isComptroller()) revert InvalidAddress();\n ensureNonzeroAddress(asset);\n\n if (\n comptroller != CORE_POOL_COMPTROLLER &&\n IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) == address(0)\n ) revert InvalidAddress();\n\n Schema schema = _getSchema(incomeType);\n uint256 currentBalance = IERC20Upgradeable(asset).balanceOf(address(this));\n uint256 assetReserve = totalAssetReserve[asset];\n\n if (currentBalance > assetReserve) {\n uint256 balanceDifference;\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n\n assetsReserves[comptroller][asset][schema] += balanceDifference;\n totalAssetReserve[asset] += balanceDifference;\n emit AssetsReservesUpdated(comptroller, asset, balanceDifference, incomeType, schema);\n }\n }\n\n /**\n * @dev asset from a particular pool to be release to distribution targets\n * @param comptroller Comptroller address(pool)\n * @param asset Asset address.\n */\n function _releaseFund(address comptroller, address asset) internal {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint256[] memory schemaBalances = new uint256[](totalSchemas);\n uint256 totalBalance;\n for (uint256 schemaValue; schemaValue < totalSchemas; ) {\n schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];\n totalBalance += schemaBalances[schemaValue];\n\n unchecked {\n ++schemaValue;\n }\n }\n\n if (totalBalance == 0) {\n return;\n }\n\n uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig memory _config = distributionTargets[i];\n\n uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;\n totalTransferAmounts[uint256(_config.schema)] += transferAmount;\n\n if (transferAmount != 0) {\n IERC20Upgradeable(asset).safeTransfer(_config.destination, transferAmount);\n IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);\n\n emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);\n }\n\n unchecked {\n ++i;\n }\n }\n\n uint256[] memory newSchemaBalances = new uint256[](totalSchemas);\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];\n assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];\n totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];\n\n emit ReservesUpdated(\n comptroller,\n asset,\n Schema(schemaValue),\n schemaBalances[schemaValue],\n newSchemaBalances[schemaValue]\n );\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the schema based on income type\n * @param incomeType type of income\n * @return schema schema for distribution\n */\n function _getSchema(IncomeType incomeType) internal view returns (Schema schema) {\n schema = Schema.ADDITIONAL_REVENUE;\n\n if (incomeType == IncomeType.SPREAD) {\n schema = Schema.PROTOCOL_RESERVES;\n }\n }\n\n /**\n * @dev This ensures that the total percentage of all the distribution targets is 100% or 0%\n */\n function _ensurePercentages() internal view {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint16[] memory totalPercentages = new uint16[](totalSchemas);\n\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n totalPercentages[uint256(config.schema)] += config.percentage;\n\n unchecked {\n ++i;\n }\n }\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)\n revert InvalidTotalPercentage();\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the underlying asset address for the vToken\n * @param vToken vToken address\n * @return asset address of asset\n */\n function _getUnderlying(address vToken) internal view returns (address) {\n if (vToken == vBNB) {\n return WBNB;\n } else {\n return IVToken(vToken).underlying();\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/RiskFundStorage.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { Ownable2StepUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n/// @title ReserveHelpersStorage\n/// @author Venus\n/// @dev Reserve helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ReserveHelpersStorage is Ownable2StepUpgradeable {\n /// @notice Deprecated slot for assetReserves mapping\n bytes32 private __deprecatedSlot1;\n\n /// @notice Available asset's fund per pool in RiskFund\n /// Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolAssetsFunds;\n\n /// @notice Deprecated slot for poolRegistry address\n bytes32 private __deprecatedSlot2;\n /// @notice Deprecated slot for status variable\n bytes32 private __deprecatedSlot3;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n uint256[46] private __gap;\n}\n\n/// @title MaxLoopsLimitHelpersStorage\n/// @author Venus\n/// @dev Max loop limit helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract MaxLoopsLimitHelpersStorage {\n /// @notice Limit for the loops to avoid the DOS\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 public maxLoopsLimit;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[49] private __gap;\n}\n\n/// @title RiskFundV1Storage\n/// @author Venus\n/// @dev Risk fund V1 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV1Storage is ReserveHelpersStorage, MaxLoopsLimitHelpersStorage {\n /// @notice Address of base asset\n address public convertibleBaseAsset;\n /// @notice Address of shortfall contract\n address public shortfall;\n\n /// @notice This state is deprecated, using it to prevent storage collision\n address private pancakeSwapRouter;\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 private minAmountToConvert;\n}\n\n/// @title RiskFundV2Storage\n/// @author Venus\n/// @dev Risk fund V2 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2Storage is RiskFundV1Storage, ReentrancyGuardUpgradeable {\n /// @notice Risk fund converter address\n address public riskFundConverter;\n}\n" + }, + "contracts/ProtocolReserve/RiskFundV2.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IRiskFund } from \"../Interfaces/IRiskFund.sol\";\nimport { IRiskFundConverter } from \"../Interfaces/IRiskFundConverter.sol\";\nimport { RiskFundV2Storage } from \"./RiskFundStorage.sol\";\n\n/// @title RiskFundV2\n/// @author Venus\n/// @notice Contract with basic features to hold base asset for different Comptrollers\n/// @dev This contract does not support BNB\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2 is AccessControlledV8, RiskFundV2Storage, IRiskFund {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Emitted when convertible base asset address is updated\n event ConvertibleBaseAssetUpdated(address indexed oldConvertibleBaseAsset, address indexed newConvertibleBaseAsset);\n\n /// @notice Emitted when risk fund converter address is updated\n event RiskFundConverterUpdated(address indexed oldRiskFundConverter, address indexed newRiskFundConverter);\n\n /// @notice Emitted when shortfall contract address is updated\n event ShortfallContractUpdated(address indexed oldShortfallContract, address indexed newShortfallContract);\n\n /// @notice Emitted when reserves are transferred for auction\n event TransferredReserveForAuction(address indexed comptroller, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred to this contract\n event PoolAssetsIncreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred from this contract on sweeping tokens\n event PoolAssetsDecreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Event emitted when tokens are swept and transferred from pool\n event SweepTokenFromPool(\n address indexed token,\n address indexed comptroller,\n address indexed receiver,\n uint256 amount\n );\n\n /// @notice Error is thrown when updatePoolState is not called by riskFundConverter\n error InvalidRiskFundConverter();\n\n /// @notice Error is thrown when transferReserveForAuction is called by non shortfall address\n error InvalidShortfallAddress();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice Error is thrown when pool reserve is less than the amount needed\n error InsufficientPoolReserve(address comptroller, uint256 amount, uint256 poolReserve);\n\n /// @dev Convertible base asset setter\n /// @param convertibleBaseAsset_ Address of the convertible base asset\n /// @custom:event ConvertibleBaseAssetUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when convertible base asset address is zero\n /// @custom:access Only Governance\n function setConvertibleBaseAsset(address convertibleBaseAsset_) external onlyOwner {\n ensureNonzeroAddress(convertibleBaseAsset_);\n emit ConvertibleBaseAssetUpdated(convertibleBaseAsset, convertibleBaseAsset_);\n convertibleBaseAsset = convertibleBaseAsset_;\n }\n\n /// @dev Risk fund converter setter\n /// @param riskFundConverter_ Address of the risk fund converter\n /// @custom:event RiskFundConverterUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when risk fund converter address is zero\n /// @custom:access Only Governance\n function setRiskFundConverter(address riskFundConverter_) external onlyOwner {\n ensureNonzeroAddress(riskFundConverter_);\n emit RiskFundConverterUpdated(riskFundConverter, riskFundConverter_);\n riskFundConverter = riskFundConverter_;\n }\n\n /// @dev Shortfall contract address setter\n /// @param shortfallContractAddress_ Address of the auction contract\n /// @custom:event ShortfallContractUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when shortfall contract address is zero\n /// @custom:access Only Governance\n function setShortfallContractAddress(address shortfallContractAddress_) external onlyOwner {\n ensureNonzeroAddress(shortfallContractAddress_);\n emit ShortfallContractUpdated(shortfall, shortfallContractAddress_);\n shortfall = shortfallContractAddress_;\n }\n\n /// @dev Transfer tokens for auction to shortfall contract\n /// @param comptroller Comptroller of the pool\n /// @param amount Amount to be transferred to the shortfall\n /// @return Amount of tokens transferred to the shortfall\n /// @custom:event TransferredReserveForAuction emit on success\n /// @custom:error InvalidShortfallAddress is thrown when caller is not shortfall contract\n /// @custom:error InsufficientPoolReserve is thrown when pool reserve is less than the amount needed\n /// @custom:access Only Shortfall contract\n function transferReserveForAuction(address comptroller, uint256 amount)\n external\n override\n nonReentrant\n returns (uint256)\n {\n uint256 poolReserve = poolAssetsFunds[comptroller][convertibleBaseAsset];\n\n if (msg.sender != shortfall) {\n revert InvalidShortfallAddress();\n }\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][convertibleBaseAsset] = poolReserve - amount;\n }\n\n IERC20Upgradeable(convertibleBaseAsset).safeTransfer(shortfall, amount);\n emit TransferredReserveForAuction(comptroller, amount);\n\n return amount;\n }\n\n /// @notice Function to sweep baseAsset for pool, Tokens are sent to address(to)\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep for the pool\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice Function to sweep token from pool\n /// @param tokenAddress Address of the asset(token)\n /// @param comptroller Pool address that the assets belong to\n /// @param receiver The receiver of the funds\n /// @param amount Amount need to sweep from the pool\n /// @custom:event Emits SweepTokenFromPool event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress, comptroller, or receiver address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Controlled by AccessControlManager\n function sweepTokenFromPool(\n address tokenAddress,\n address comptroller,\n address receiver,\n uint256 amount\n ) external nonReentrant {\n _checkAccessAllowed(\"sweepTokenFromPool(address,address,address,uint256)\");\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(comptroller);\n ensureNonzeroAddress(receiver);\n ensureNonzeroValue(amount);\n\n uint256 poolReserve = poolAssetsFunds[comptroller][tokenAddress];\n\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][tokenAddress] = poolReserve - amount;\n }\n\n IERC20Upgradeable(tokenAddress).safeTransfer(receiver, amount);\n\n emit SweepTokenFromPool(tokenAddress, comptroller, receiver, amount);\n }\n\n /**\n * @notice Get the Amount of the Base asset in the risk fund for the specific pool.\n * @param comptroller Comptroller address(pool).\n * @return Base Asset's reserve in risk fund.\n */\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256) {\n return poolAssetsFunds[comptroller][convertibleBaseAsset];\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// @param comptroller Comptroller address (pool)\n /// @param asset Address of the asset(token)\n /// @param amount Amount transferred for the pool\n /// @custom:event PoolAssetsIncreased emits on success\n /// @custom:error InvalidRiskFundConverter is thrown if caller is not riskFundConverter contract\n /// @custom:access Only RiskFundConverter contract\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) public {\n if (msg.sender != riskFundConverter) {\n revert InvalidRiskFundConverter();\n }\n\n poolAssetsFunds[comptroller][asset] += amount;\n emit PoolAssetsIncreased(comptroller, asset, amount);\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n function preSweepToken(address tokenAddress, uint256 amount) internal {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n\n address[] memory pools = IRiskFundConverter(riskFundConverter).getPools(tokenAddress);\n\n uint256 assetReserves;\n uint256 poolsLength = pools.length;\n for (uint256 i; i < poolsLength; ) {\n assetReserves += poolAssetsFunds[pools[i]][tokenAddress];\n unchecked {\n ++i;\n }\n }\n\n uint256 balanceDiff = balance - assetReserves;\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n uint256 distributedShare;\n for (uint256 i; i < poolsLength; ) {\n if (poolAssetsFunds[pools[i]][tokenAddress] != 0) {\n uint256 poolAmountShare;\n if (i < (poolsLength - 1)) {\n poolAmountShare = (poolAssetsFunds[pools[i]][tokenAddress] * amount) / assetReserves;\n distributedShare += poolAmountShare;\n } else {\n poolAmountShare = amountDiff - distributedShare;\n }\n poolAssetsFunds[pools[i]][tokenAddress] -= poolAmountShare;\n emit PoolAssetsDecreased(pools[i], tokenAddress, poolAmountShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/XVSVaultTreasury.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IXVSVault } from \"../Interfaces/IXVSVault.sol\";\n\n/// @title XVSVaultTreasury\n/// @author Venus\n/// @notice XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract XVSVaultTreasury is AccessControlledV8, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice The xvs token address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable XVS_ADDRESS;\n\n /// @notice The xvsvault address\n address public xvsVault;\n\n /// @notice Emitted when XVS vault address is updated\n event XVSVaultUpdated(address indexed oldXVSVault, address indexed newXVSVault);\n\n /// @notice Emitted when funds transferred to XVSStore address\n event FundsTransferredToXVSStore(address indexed xvsStore, uint256 amountMantissa);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Thrown when given input amount is zero\n error InsufficientBalance();\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n /// @param xvsAddress_ XVS token address\n constructor(address xvsAddress_) {\n ensureNonzeroAddress(xvsAddress_);\n XVS_ADDRESS = xvsAddress_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param xvsVault_ XVSVault address\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function initialize(address accessControlManager_, address xvsVault_) public initializer {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n _setXVSVault(xvsVault_);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function setXVSVault(address xvsVault_) external onlyOwner {\n _setXVSVault(xvsVault_);\n }\n\n /// @notice This function transfers funds to the XVS vault\n /// @param amountMantissa Amount to be sent to XVS vault\n /// @custom:event FundsTransferredToXVSStore emits on success\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n /// @custom:access Restricted by ACM\n function fundXVSVault(uint256 amountMantissa) external nonReentrant {\n _checkAccessAllowed(\"fundXVSVault(uint256)\");\n ensureNonzeroValue(amountMantissa);\n\n uint256 balance = IERC20Upgradeable(XVS_ADDRESS).balanceOf(address(this));\n\n if (balance < amountMantissa) {\n revert InsufficientBalance();\n }\n\n address xvsStore = IXVSVault(xvsVault).xvsStore();\n ensureNonzeroAddress(xvsStore);\n IERC20Upgradeable(XVS_ADDRESS).safeTransfer(xvsStore, amountMantissa);\n\n emit FundsTransferredToXVSStore(xvsStore, amountMantissa);\n }\n\n /// @notice Function to sweep tokens from the contract\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep from the contract\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function _setXVSVault(address xvsVault_) internal {\n ensureNonzeroAddress(xvsVault_);\n emit XVSVaultUpdated(xvsVault, xvsVault_);\n xvsVault = xvsVault_;\n }\n}\n" + }, + "contracts/Test/imports.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n// This file is needed to make hardhat and typechain generate artifacts for\n// contracts we depend on (e.g. in tests or deployments) but not use directly.\n// Another way to do this would be to use hardhat-dependency-compiler, but\n// since we only have a couple of dependencies, installing a separate package\n// seems an overhead.\n\nimport { UpgradeableBeacon } from \"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\";\nimport { BeaconProxy } from \"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\n" + }, + "contracts/Test/Mocks/MockACM.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControl } from \"@openzeppelin/contracts/access/AccessControl.sol\";\n\ncontract MockACM is AccessControl {\n /// @notice Emitted when an account is given a permission to a certain contract function\n /// @dev If contract address is 0x000..0 this means that the account is a default admin of this function and\n /// can call any contract function with this signature\n event PermissionGranted(address account, address contractAddress, string functionSig);\n\n /// @notice Emitted when an account is revoked a permission to a certain contract function\n event PermissionRevoked(address account, address contractAddress, string functionSig);\n\n constructor() {\n // Grant the contract deployer the default admin role: it will be able\n // to grant and revoke any roles\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n }\n\n /**\n * @notice Gives a function call permission to one single account\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * @param contractAddress address of contract for which call permissions will be granted\n * @dev if contractAddress is zero address, the account can access the specified function\n * on **any** contract managed by this ACL\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @param accountToPermit account that will be given access to the contract function\n * @custom:event Emits a {RoleGranted} and {PermissionGranted} events.\n */\n function giveCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToPermit\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n grantRole(role, accountToPermit);\n emit PermissionGranted(accountToPermit, contractAddress, functionSig);\n }\n\n /**\n * @notice Revokes an account's permission to a particular function call\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * \t\tMay emit a {RoleRevoked} event.\n * @param contractAddress address of contract for which call permissions will be revoked\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @custom:event Emits {RoleRevoked} and {PermissionRevoked} events.\n */\n function revokeCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToRevoke\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n revokeRole(role, accountToRevoke);\n emit PermissionRevoked(accountToRevoke, contractAddress, functionSig);\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev Since restricted contracts using this function as a permission hook, we can get contracts address with msg.sender\n * @param account for which call permissions will be checked\n * @param functionSig restricted function signature e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n *\n */\n function isAllowedToCall(address account, string memory functionSig) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(msg.sender, functionSig));\n\n if (hasRole(role, account)) {\n return true;\n } else {\n role = keccak256(abi.encodePacked(address(0), functionSig));\n return hasRole(role, account);\n }\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev This function is used as a view function to check permissions rather than contract hook for access restriction check.\n * @param account for which call permissions will be checked against\n * @param contractAddress address of the restricted contract\n * @param functionSig signature of the restricted function e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n */\n function hasPermission(\n address account,\n address contractAddress,\n string memory functionSig\n ) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n return hasRole(role, account);\n }\n}\n" + }, + "contracts/Test/Mocks/MockArraySorter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\nimport { sort } from \"../../Utils/ArrayHelpers.sol\";\n\ncontract MockArraySorter {\n function sortArray(uint256[] memory balances, address[] memory addrs)\n external\n view\n returns (address[] memory, uint256[] memory)\n {\n sort(balances, addrs);\n return (addrs, balances);\n }\n}\n" + }, + "contracts/Test/Mocks/MockConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\n\nimport { AbstractTokenConverter } from \"../../TokenConverter/AbstractTokenConverter.sol\";\nimport { IRiskFundGetters } from \"../../Interfaces/IRiskFund.sol\";\n\ncontract MockConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) public assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolsAssetsReserves;\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n function mockPrivateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 balanceDiff\n ) external {\n _privateConversion(comptroller, tokenAddressOut, balanceDiff);\n }\n\n function AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) public initializer {\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n assetsReserves[tokenAddressIn] += convertedTokenInBalance;\n poolsAssetsReserves[comptroller][tokenAddressIn] += convertedTokenInBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @notice Get base asset address\n function _getDestinationBaseAsset() internal view override returns (address) {\n return IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/Test/Mocks/MockDeflationaryToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\ncontract MockDeflatingToken {\n string public constant NAME = \"Deflating Test Token\";\n string public constant SYMBOL = \"DTT\";\n uint8 public constant DECIMALS = 18;\n uint256 public totalSupply;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n bytes32 public immutable DOMAIN_SEPARATOR;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint256) public nonces;\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(uint256 _totalSupply) {\n uint256 chainId;\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = keccak256(\n abi.encode(\n keccak256(\"EIP712Domain(string NAME,string version,uint256 chainId,address verifyingContract)\"),\n keccak256(bytes(NAME)),\n keccak256(bytes(\"1\")),\n chainId,\n address(this)\n )\n );\n _mint(msg.sender, _totalSupply);\n }\n\n function approve(address spender, uint256 value) external returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\n }\n\n function transfer(address to, uint256 value) external returns (bool) {\n _transfer(msg.sender, to, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max) {\n allowance[from][msg.sender] = allowance[from][msg.sender] - value;\n }\n _transfer(from, to, value);\n return true;\n }\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 require(deadline >= block.timestamp, \"EXPIRED\");\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR,\n keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, \"INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n\n function _mint(address to, uint256 value) internal {\n totalSupply = totalSupply + value;\n balanceOf[to] = balanceOf[to] + value;\n emit Transfer(address(0), to, value);\n }\n\n function _burn(address from, uint256 value) internal {\n balanceOf[from] = balanceOf[from] - value;\n totalSupply = totalSupply - value;\n emit Transfer(from, address(0), value);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value\n ) private {\n allowance[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 value\n ) private {\n uint256 burnAmount = value / 100;\n _burn(from, burnAmount);\n uint256 transferAmount = value - burnAmount;\n balanceOf[from] = balanceOf[from] - transferAmount;\n balanceOf[to] = balanceOf[to] + transferAmount;\n emit Transfer(from, to, transferAmount);\n }\n}\n" + }, + "contracts/Test/Mocks/MockRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { RiskFundConverter } from \"../../TokenConverter/RiskFundConverter.sol\";\n\ncontract MockRiskFundConverter is RiskFundConverter {\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) RiskFundConverter(corePoolComptroller_, vBNB_, nativeWrapped_) {}\n\n function postConversionHookMock(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) external {\n super._postConversionHook(tokenInAddress, tokenOutAddress, amountIn, amountOut);\n }\n\n function preTransferHookMock(address tokenOutAddress, uint256 amountOut) external {\n super._preTransferHook(tokenOutAddress, amountOut);\n }\n\n function setAssetsReserves(address asset, uint256 amount) external {\n assetsReserves[asset] = amount;\n }\n\n function setPoolsAssetsReserves(\n address comptroller,\n address asset,\n uint256 amount\n ) external {\n poolsAssetsReserves[comptroller][asset] = amount;\n }\n\n function getPoolsAssetsReserves(address comptroller, address asset) external view returns (uint256) {\n return poolsAssetsReserves[comptroller][asset];\n }\n\n function getAssetsReserves(address asset) external view returns (uint256) {\n return assetsReserves[asset];\n }\n}\n" + }, + "contracts/Test/Mocks/MockToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)\n\npragma solidity 0.8.25;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract MockToken is ERC20 {\n uint8 private immutable _decimals;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_\n ) ERC20(name_, symbol_) {\n _decimals = decimals_;\n }\n\n function faucet(uint256 amount) external {\n _mint(msg.sender, amount);\n }\n\n function allocateTo(address owner, uint256 amount) external {\n _mint(owner, amount);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "contracts/TokenConverter/AbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\nimport { MANTISSA_ONE, EXP_SCALE } from \"@venusprotocol/solidity-utilities/contracts/constants.sol\";\n\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title AbstractTokenConverter\n/// @author Venus\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\n/*\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\n *\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\n * a. convertExactTokensSupportingFeeOnTransferTokens\n * b. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\n * similar to Case I.\n *\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * a. convertExactTokens\n * b. convertForExactTokens\n * c. convertExactTokensSupportingFeeOnTransferTokens\n * d. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * similar to Case III.\n *\n * ------------------------------------------------------------------------------------------------------------------------------------\n * Example 1:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInAmount - 100\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\n * function for tokenIn as deflationary token.\n *\n * Example 2:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\n * tokenOutAmount - 70\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\n * ------------------------------------------------------------------------------------------------------------------------------------\n *\n * This contract also supports private conversion between the converters:\n * Private conversions:\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\n *\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\n *\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\n * tokenAddressOut: As base asset of that converter.\n *\n * ConverterNetwork:\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\n * and tokenAddressOut provided.\n *\n * findTokenConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\n *\n * findTokenConvertersForConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\n */\n\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Maximum incentive could be\n uint256 public constant MAX_INCENTIVE = 0.5e18;\n\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\n uint256 public minAmountToConvert;\n\n /// @notice Venus price oracle contract\n ResilientOracle public priceOracle;\n\n /// @notice conversion configurations for the existing pairs\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\n\n /// @notice Address that all incoming tokens are transferred to\n address public destinationAddress;\n\n /// @notice Boolean for if conversion is paused\n bool public conversionPaused;\n\n /// @notice Address of the converterNetwork contract\n IConverterNetwork public converterNetwork;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[45] private __gap;\n\n /// @notice Emitted when config is updated for tokens pair\n event ConversionConfigUpdated(\n address indexed tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 oldIncentive,\n uint256 newIncentive,\n ConversionAccessibility oldAccess,\n ConversionAccessibility newAccess\n );\n /// @notice Emitted when price oracle address is updated\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\n\n /// @notice Emitted when destination address is updated\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\n\n /// @notice Emitted when converterNetwork address is updated\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\n\n /// @notice Emitted when exact amount of tokens are converted for tokens\n event ConvertedExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens\n event ConvertedForExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when conversion is paused\n event ConversionPaused(address indexed sender);\n\n /// @notice Emitted when conversion is unpaused\n event ConversionResumed(address indexed sender);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Emitted when minimum amount to convert is updated\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\n\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\n error AmountOutMismatched();\n\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\n error AmountInMismatched();\n\n /// @notice Thrown when given input amount is zero\n error InsufficientInputAmount();\n\n /// @notice Thrown when given output amount is zero\n error InsufficientOutputAmount();\n\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\n error ConversionConfigNotEnabled();\n\n /// @notice Thrown when conversion is enabled only for private conversions\n error ConversionEnabledOnlyForPrivateConversions();\n\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n error InvalidToAddress();\n\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\n\n /// @notice Thrown when amountOut is lower than amountOutMin\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\n\n /// @notice Thrown when amountIn is higher than amountInMax\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\n\n /// @notice Thrown when conversion is paused\n error ConversionTokensPaused();\n\n /// @notice Thrown when conversion is Active\n error ConversionTokensActive();\n\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\n error InvalidTokenConfigAddresses();\n\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\n error InsufficientPoolLiquidity();\n\n /// @notice When address of the ConverterNetwork is not set or Zero address\n error InvalidConverterNetwork();\n\n /// @notice Thrown when trying to set non zero incentive for private conversion\n error NonZeroIncentiveForPrivateConversion();\n\n /// @notice Thrown when using convertForExactTokens deflationary tokens\n error DeflationaryTokenNotSupported();\n\n /// @notice Thrown when minimum amount to convert is zero\n error InvalidMinimumAmountToConvert();\n\n /// @notice Thrown when there is a mismatch in the length of input arrays\n error InputLengthMisMatch();\n\n /**\n * @notice Modifier to ensure valid conversion parameters for a token conversion\n * and check if conversion is paused or not\n * @param to The recipient address for the converted tokens\n * @param tokenAddressIn The input token address for the conversion\n * @param tokenAddressOut The output token address for the conversion\n */\n modifier validConversionParameters(\n address to,\n address tokenAddressIn,\n address tokenAddressOut\n ) {\n _checkConversionPaused();\n ensureNonzeroAddress(to);\n if (to == tokenAddressIn || to == tokenAddressOut) {\n revert InvalidToAddress();\n }\n _;\n }\n\n /// @notice Pause conversion of tokens\n /// @custom:event Emits ConversionPaused on success\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\n /// @custom:access Restricted by ACM\n function pauseConversion() external {\n _checkAccessAllowed(\"pauseConversion()\");\n _checkConversionPaused();\n conversionPaused = true;\n emit ConversionPaused(msg.sender);\n }\n\n /// @notice Resume conversion of tokens.\n /// @custom:event Emits ConversionResumed on success\n /// @custom:error ConversionTokensActive thrown when conversion is already active\n /// @custom:access Restricted by ACM\n function resumeConversion() external {\n _checkAccessAllowed(\"resumeConversion()\");\n if (!conversionPaused) {\n revert ConversionTokensActive();\n }\n\n conversionPaused = false;\n emit ConversionResumed(msg.sender);\n }\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:access Only Governance\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\n _setPriceOracle(priceOracle_);\n }\n\n /// @notice Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:access Only Governance\n function setDestination(address destinationAddress_) external onlyOwner {\n _setDestination(destinationAddress_);\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:access Only Governance\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\n _setConverterNetwork(converterNetwork_);\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:access Only Governance\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\n _checkAccessAllowed(\"setMinAmountToConvert(uint256)\");\n _setMinAmountToConvert(minAmountToConvert_);\n }\n\n /// @notice Batch sets the conversion configurations\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressesOut Array of addresses of tokenOut\n /// @param conversionConfigs Array of conversionConfig config details to update\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\n function setConversionConfigs(\n address tokenAddressIn,\n address[] calldata tokenAddressesOut,\n ConversionConfig[] calldata conversionConfigs\n ) external {\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\n\n for (uint256 i; i < tokenOutArrayLength; ) {\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountIn != amountInMantissa) {\n revert AmountInMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\n /// otherwise the amount is adjusted\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountOut != amountOutMantissa) {\n revert AmountOutMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\n /// @param tokenAddress The address of the ERC-20 token to sweep\n /// @param to The address to which tokens will be transferred\n /// @param amount The amount to transfer\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\n /// @dev This function retrieves values without altering token prices\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n amountConvertedMantissa = amountInMantissa;\n uint256 tokenInToOutConversion;\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountConvertedMantissa = _divRoundingUp(maxTokenOutReserve * EXP_SCALE, tokenInToOutConversion);\n amountOutMantissa = maxTokenOutReserve;\n }\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @dev This function retrieves values without altering token prices\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountOutMantissa = maxTokenOutReserve;\n }\n\n amountConvertedMantissa = amountOutMantissa;\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountInMantissa;\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountOutMantissa;\n }\n\n /// @notice This method updated the states of this contract after getting funds from PSR\n /// after settling the amount(if any) through privateConversion between converters\n /// @dev This function is called by protocolShareReserve\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\n if (balanceDiff > 0) {\n _privateConversion(comptroller, asset, balanceDiff);\n }\n }\n\n /// @notice Set the configuration for new or existing conversion pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n /// @custom:event Emits ConversionConfigUpdated event on success\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\n /// @custom:access Controlled by AccessControlManager\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) public {\n _checkAccessAllowed(\"setConversionConfig(address,address,ConversionConfig)\");\n ensureNonzeroAddress(tokenAddressIn);\n ensureNonzeroAddress(tokenAddressOut);\n\n if (conversionConfig.incentive > MAX_INCENTIVE) {\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\n }\n\n if (\n (tokenAddressIn == tokenAddressOut) ||\n (tokenAddressIn != _getDestinationBaseAsset()) ||\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\n ) {\n revert InvalidTokenConfigAddresses();\n }\n\n if (\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\n conversionConfig.incentive != 0\n ) {\n revert NonZeroIncentiveForPrivateConversion();\n }\n\n if (\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\n (address(converterNetwork) == address(0))\n ) {\n revert InvalidConverterNetwork();\n }\n\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n emit ConversionConfigUpdated(\n tokenAddressIn,\n tokenAddressOut,\n configuration.incentive,\n conversionConfig.incentive,\n configuration.conversionAccess,\n conversionConfig.conversionAccess\n );\n\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\n } else {\n configuration.incentive = conversionConfig.incentive;\n configuration.conversionAccess = conversionConfig.conversionAccess;\n }\n }\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\n\n /// @dev Operations to perform before sweeping tokens\n /// @param token Address of the token\n /// @param amount Amount transferred to address(to)\n function preSweepToken(address token, uint256 amount) internal virtual {}\n\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function _convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n if (amountOutMantissa < amountOutMinMantissa) {\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n }\n\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\n /// it is called by convertForExactTokens function\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n if (actualAmountIn != amountInMantissa) {\n revert DeflationaryTokenNotSupported();\n }\n\n if (actualAmountIn > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n actualAmountOut = amountOutMantissa;\n }\n\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n if (amountInMantissa > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\n }\n\n /// @dev return actualAmountOut from reserves for tokenAddressOut\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\n function _doTransferOut(\n address tokenAddressOut,\n address to,\n uint256 amountConvertedMantissa\n ) internal {\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountConvertedMantissa) {\n revert InsufficientPoolLiquidity();\n }\n\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\n\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\n tokenOut.safeTransfer(to, amountConvertedMantissa);\n }\n\n /// @notice Transfer tokenAddressIn from user to destination\n /// @param tokenAddressIn Address of the token to convert\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @return actualAmountIn Actual amount transferred to destination\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\n }\n\n /// @dev Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:event Emits PriceOracleUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\n ensureNonzeroAddress(address(priceOracle_));\n emit PriceOracleUpdated(priceOracle, priceOracle_);\n priceOracle = priceOracle_;\n }\n\n /// @dev Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:event Emits DestinationAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\n function _setDestination(address destinationAddress_) internal {\n ensureNonzeroAddress(destinationAddress_);\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\n destinationAddress = destinationAddress_;\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\n ensureNonzeroAddress(address(converterNetwork_));\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\n converterNetwork = converterNetwork_;\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:event MinAmountToConvertUpdated is emitted in success\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\n ensureNonzeroValue(minAmountToConvert_);\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\n minAmountToConvert = minAmountToConvert_;\n }\n\n /// @dev Hook to perform after converting tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param amountIn Amount of tokenIn converted\n /// @param amountOut Amount of tokenOut converted\n function _postConversionHook(\n address tokenAddressIn,\n address tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n ) internal virtual {}\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init_unchained(\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n _setPriceOracle(priceOracle_);\n _setDestination(destinationAddress_);\n _setMinAmountToConvert(minAmountToConvert_);\n conversionPaused = false;\n }\n\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return Amount of asset, for _privateConversion\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\n\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\n /// destination contract as destination's base asset\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\n function _privateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 amountToConvert\n ) internal {\n address tokenAddressIn = _getDestinationBaseAsset();\n address _destinationAddress = destinationAddress;\n uint256 convertedTokenInBalance;\n if (address(converterNetwork) != address(0)) {\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\n uint256 convertersLength = converterAddresses.length;\n for (uint256 i; i < convertersLength; ) {\n if (converterBalances[i] == 0) break;\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\n converterBalances[i],\n tokenAddressOut,\n tokenAddressIn\n );\n if (amountIn > amountToConvert) {\n amountIn = amountToConvert;\n }\n\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\n break;\n }\n\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n\n IERC20Upgradeable(tokenAddressOut).forceApprove(converterAddresses[i], amountIn);\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\n amountIn,\n 0,\n tokenAddressOut,\n tokenAddressIn,\n _destinationAddress\n );\n\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n amountToConvert -= amountIn;\n convertedTokenInBalance += (balanceAfter - balanceBefore);\n\n if (amountToConvert == 0) break;\n unchecked {\n ++i;\n }\n }\n }\n\n _postPrivateConversionHook(\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance,\n tokenAddressOut,\n amountToConvert\n );\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal virtual {}\n\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\n\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\n /// @param amountIn The amount to convert\n /// @param tokenAddress Address of the token\n /// @return isValid true if amount to convert is greater than minimum amount to convert\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\n priceOracle.updateAssetPrice(tokenAddress);\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\n\n if (amountInInUsd >= minAmountToConvert) {\n isValid = true;\n }\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\n if (amountInMantissa == 0) {\n revert InsufficientInputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\n /// multiplied by conversionWithIncentive which will be >= 1\n amountOutMantissa = (amountInMantissa * tokenInToOutConversion) / (EXP_SCALE);\n }\n\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\n if (amountOutMantissa == 0) {\n revert InsufficientOutputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\n converterNetwork.isTokenConverter(msg.sender);\n if (isPrivateConversion) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\n if (isPrivateConversion) {\n amountInMantissa =\n (amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE) /\n (tokenInUnderlyingPrice * conversionWithIncentive);\n } else {\n amountInMantissa = _divRoundingUp(\n amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE,\n tokenInUnderlyingPrice * conversionWithIncentive\n );\n }\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n }\n\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\n if (\n (!(isConverter) &&\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n }\n\n /// @dev To check, is conversion paused\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\n function _checkConversionPaused() internal view {\n if (conversionPaused) {\n revert ConversionTokensPaused();\n }\n }\n\n /// @dev Get base asset address of the destination contract\n /// @return Address of the base asset\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\n\n /// @dev Performs division where the result is rounded up\n /// @param numerator The numerator of the division operation\n /// @param denominator The denominator of the division operation. Must be non-zero\n /// @return The result of the division, rounded up\n function _divRoundingUp(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\n return (numerator + denominator - 1) / denominator;\n }\n}\n" + }, + "contracts/TokenConverter/ConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { sort } from \"../Utils/ArrayHelpers.sol\";\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title ConverterNetwork\n/// @author Venus\n/// @notice ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ConverterNetwork is IConverterNetwork, AccessControlledV8, MaxLoopsLimitHelper {\n /// @notice Array holding all the converters\n IAbstractTokenConverter[] public allConverters;\n\n /// @notice Emitted when new converter is added\n event ConverterAdded(address indexed converter);\n\n /// @notice Emitted when converter is removed\n event ConverterRemoved(address indexed converter);\n\n /// @notice Error thrown when converter already exists\n error ConverterAlreadyExists();\n\n /// @notice Error thrown converter does not exist\n error ConverterDoesNotExist();\n\n /// @notice Error thrown when converter address is invalid\n error InvalidTokenConverterAddress();\n\n /// @notice Error thrown when loops limit is invalid\n error InvalidMaxLoopsLimit(uint256 loopsLimit);\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @notice ConverterNetwork initializer\n /// @param _accessControlManager The address of ACM contract\n /// @param _loopsLimit Limit for the loops in the contract to avoid DOS\n /// @custom:event ConverterAdded is emitted for each converter added on success\n /// @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n ensureNonzeroAddress(_accessControlManager);\n __AccessControlled_init(_accessControlManager);\n\n if (_loopsLimit >= type(uint128).max) revert InvalidMaxLoopsLimit(_loopsLimit);\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n * @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n * @custom:access Only owner\n */\n function setMaxLoopsLimit(uint256 limit) external onlyOwner {\n if (limit >= type(uint128).max) revert InvalidMaxLoopsLimit(limit);\n _setMaxLoopsLimit(limit);\n }\n\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:event ConverterAdded is emitted on success\n /// @custom:access Only Governance\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"addTokenConverter(address)\");\n _addTokenConverter(_tokenConverter);\n }\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterDoesNotExist is thrown when converter to remove does not exist\n /// @custom:event ConverterRemoved is emitted on success\n /// @custom:access Only Governance\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"removeTokenConverter(address)\");\n\n // Find the index of the converter in the array\n uint128 indexToRemove = _findConverterIndex(_tokenConverter);\n\n // Ensure that the converter exists in the array\n if (indexToRemove == type(uint128).max) revert ConverterDoesNotExist();\n\n // Swap the element to remove with the last element\n allConverters[indexToRemove] = allConverters[allConverters.length - 1];\n\n // Remove the last element (which is now a duplicate)\n allConverters.pop();\n\n emit ConverterRemoved(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to users for conversion\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, false);\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to converters for conversion.\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, true);\n }\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return converters Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory converters) {\n converters = allConverters;\n }\n\n /// @notice This function checks if the given address is a converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return isConverter true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool isConverter) {\n uint128 index = _findConverterIndex(IAbstractTokenConverter(_tokenConverter));\n\n if (index != type(uint128).max) {\n isConverter = true;\n }\n }\n\n /// @notice Adds new converter contract to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterAlreadyExists is thrown when new tokenconverter to add already exists\n /// @custom:event ConverterAdded is emitted on success\n function _addTokenConverter(IAbstractTokenConverter _tokenConverter) internal {\n if (\n (address(_tokenConverter) == address(0)) || (address(_tokenConverter.converterNetwork()) != address(this))\n ) {\n revert InvalidTokenConverterAddress();\n }\n\n uint128 index = _findConverterIndex(_tokenConverter);\n if (index != type(uint128).max) revert ConverterAlreadyExists();\n\n allConverters.push(_tokenConverter);\n _ensureMaxLoops(allConverters.length);\n\n emit ConverterAdded(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @param forConverters Bool to filter out converters on the basis of the conversionAccess\n /// @return converters Array of converters\n /// @return convertersBalance Array of balances with respect to token out\n function _findTokenConverters(\n address _tokenAddressIn,\n address _tokenAddressOut,\n bool forConverters\n ) internal returns (address[] memory converters, uint256[] memory convertersBalance) {\n uint128 convertersLength = uint128(allConverters.length);\n\n // Create a dynamic array to store the matching converters\n converters = new address[](convertersLength);\n convertersBalance = new uint256[](convertersLength);\n uint128 count;\n\n for (uint128 i; i < convertersLength; ) {\n IAbstractTokenConverter converter = allConverters[i];\n\n unchecked {\n ++i;\n }\n\n if ((address(converter.converterNetwork()) != address(this)) || msg.sender == address(converter)) {\n continue;\n }\n\n (, IAbstractTokenConverter.ConversionAccessibility conversionAccess) = converter.conversionConfigurations(\n _tokenAddressIn,\n _tokenAddressOut\n );\n\n if (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ALL) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n forConverters &&\n (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_CONVERTERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n !forConverters && (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_USERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n }\n }\n\n // Resize the array to the actual number of matching converters\n assembly {\n mstore(converters, count)\n mstore(convertersBalance, count)\n }\n sort(convertersBalance, converters);\n }\n\n /// @notice Used to get the index of the converter stored in the array\n /// This will return the index if the converter exists in the array otherwise will return type(uint128).max\n /// @param _tokenConverter Address of the token converter\n /// @return index of the converter address in the allConverters array\n function _findConverterIndex(IAbstractTokenConverter _tokenConverter) internal view returns (uint128 index) {\n index = type(uint128).max; // Not found, return a large value\n\n uint128 convertersLength = uint128(allConverters.length);\n for (uint128 i; i < convertersLength; ) {\n if (allConverters[i] == _tokenConverter) {\n index = i;\n }\n unchecked {\n ++i;\n }\n }\n }\n}\n" + }, + "contracts/TokenConverter/IAbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @notice Interface for AbstractTokenConverter\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ninterface IAbstractTokenConverter {\n /// @notice This enum define the all possible ways of conversion can happen\n enum ConversionAccessibility {\n NONE, // Conversion is disable for the pair\n ALL, // Conversion is enable for private conversion and users\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\n ONLY_FOR_USERS // Conversion is enable only for users\n }\n\n /// @notice This struct represents the configuration for a token conversion.\n struct ConversionConfig {\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\n uint256 incentive;\n /// enable or disable conversion for users or converters or both or none\n ConversionAccessibility conversionAccess;\n }\n\n /// @notice Pause conversion of tokens\n function pauseConversion() external;\n\n /// @notice Resume conversion of tokens.\n function resumeConversion() external;\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n function setPriceOracle(ResilientOracle priceOracle_) external;\n\n /// @notice Set the configuration for new or existing convert pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) external;\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Get the configuration for the pair of the tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\n /// @return conversionAccess Accessibility for the pair of tokens\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\n external\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\n\n /// @notice Get the address of the converterNetwork\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) external view returns (uint256 tokenBalance);\n}\n" + }, + "contracts/TokenConverter/RiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IRiskFund, IRiskFundGetters } from \"../Interfaces/IRiskFund.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\n\n/// @title RiskFundConverter\n/// @author Venus\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the core pool comptroller\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n ///@notice Address of the vBNB\n ///@dev This address is used to include the BNB market while in getPools method\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable VBNB;\n\n ///@notice Address of the native wrapped currency\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable NATIVE_WRAPPED;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) internal assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\n\n /// @notice Address of pool registry contract\n address public poolRegistry;\n\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\n\n // Error thrown when comptrollers array length is not equal to assets array length\n error InvalidArguments();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice thrown when asset does not exist in the pool\n error MarketNotExistInPool(address comptroller, address asset);\n\n /// @notice thrown to prevent reentrancy\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\n /// cannot be called recursively within the same transaction.\n error ReentrancyGuardError();\n\n /// @param corePoolComptroller_ Address of the Comptroller pool\n /// @param vBNB_ Address of the vBNB\n /// @param nativeWrapped_ Address of the wrapped native currency\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) {\n ensureNonzeroAddress(corePoolComptroller_);\n ensureNonzeroAddress(vBNB_);\n ensureNonzeroAddress(nativeWrapped_);\n\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\n VBNB = vBNB_;\n NATIVE_WRAPPED = nativeWrapped_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param poolRegistry_ Address of the pool registry\n /// @param minAmountToConvert_ minimum amount to convert\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address poolRegistry_,\n uint256 minAmountToConvert_,\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) public initializer {\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n ensureNonzeroAddress(poolRegistry_);\n poolRegistry = poolRegistry_;\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Pool registry setter\n /// @param poolRegistry_ Address of the pool registry\n /// @custom:event PoolRegistryUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:access Only Governance\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\n ensureNonzeroAddress(poolRegistry_);\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\n poolRegistry = poolRegistry_;\n }\n\n /// @notice Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:access Restricted by ACM\n function setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) external {\n _checkAccessAllowed(\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\");\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return reserves Asset's reserve in risk fund\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n reserves = poolsAssetsReserves[comptroller][asset];\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Reserves of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n tokenBalance = assetsReserves[tokenAddress];\n }\n\n /// @notice Get the array of all pools addresses\n /// @param tokenAddress Address of the token\n /// @return poolsWithCore Array of the pools addresses in which token is available\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\n\n if (isAssetListedInCore(tokenAddress)) {\n uint256 poolsLength = poolsWithCore.length;\n address[] memory extendedPools = new address[](poolsLength + 1);\n\n for (uint256 i; i < poolsLength; ) {\n extendedPools[i] = poolsWithCore[i];\n unchecked {\n ++i;\n }\n }\n\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\n poolsWithCore = extendedPools;\n }\n }\n\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\n assetsReserves[tokenOutAddress] -= amountOut;\n }\n\n /// @notice Hook to perform after converting tokens\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\n /// @param tokenInAddress Address of the tokenIn\n /// @param tokenOutAddress Address of the tokenOut\n /// @param amountIn Amount of tokenIn transferred\n /// @param amountOut Amount of tokenOut transferred\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\n function _postConversionHook(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) internal override {\n address[] memory pools = getPools(tokenOutAddress);\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\n ensureNonzeroValue(assetReserve);\n\n uint256 poolsLength = pools.length;\n uint256 distributedOutShare;\n uint256 poolAmountInShare;\n uint256 distributedInShare;\n\n for (uint256 i; i < poolsLength; ) {\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\n if (currentPoolsAssetsReserves != 0) {\n if (i < (poolsLength - 1)) {\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\n distributedInShare += poolAmountInShare;\n } else {\n uint256 distributedDiff = amountOut - distributedOutShare;\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\n poolAmountInShare = amountIn - distributedInShare;\n }\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n\n address[] memory pools = getPools(tokenAddress);\n uint256 assetReserve = assetsReserves[tokenAddress];\n uint256 poolsLength = pools.length;\n uint256 distributedShare;\n\n for (uint256 i; i < poolsLength; ) {\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\n if (i < (poolsLength - 1)) {\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\n } else {\n uint256 distributedDiff = amountDiff - distributedShare;\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\n }\n }\n unchecked {\n ++i;\n }\n }\n assetsReserves[tokenAddress] -= amountDiff;\n }\n }\n\n /// @dev Update the poolAssetsReserves upon transferring the tokens\n /// @param pool Address of the pool\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @param assetReserve Asset's reserve for the pool\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\n /// @custom:event AssetsReservesUpdated emits on success\n function updatePoolAssetsReserve(\n address pool,\n address tokenAddress,\n uint256 amount,\n uint256 assetReserve\n ) internal returns (uint256 poolAmountShare) {\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\n }\n\n /// @dev Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\n function _setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) internal {\n uint256 comptrollersLength = comptrollers.length;\n\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\n revert InvalidArguments();\n }\n\n for (uint256 i; i < comptrollersLength; ) {\n address[] memory poolAssets = assets[i];\n bool[] memory assetsValues = values[i];\n uint256 poolAssetsLength = poolAssets.length;\n\n if (poolAssetsLength != assetsValues.length) {\n revert InvalidArguments();\n }\n\n for (uint256 j; j < poolAssetsLength; ) {\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\n unchecked {\n ++j;\n }\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// and transferring funds to the protocol share reserve\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return balanceDifference Amount of asset, for _privateConversion\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n function _updateAssetsState(address comptroller, address asset)\n internal\n override\n returns (uint256 balanceDifference)\n {\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 currentBalance = token.balanceOf(address(this));\n uint256 assetReserve = assetsReserves[asset];\n if (currentBalance > assetReserve) {\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\n token.safeTransfer(destinationAddress, balanceDifference);\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\n\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\n IRiskFund(destinationAddress).updatePoolState(\n comptroller,\n asset,\n newDestinationBalance - previousDestinationBalance\n );\n balanceDifference = 0;\n }\n }\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n emit AssetTransferredToDestination(\n destinationAddress,\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance\n );\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @dev This function checks for the given asset is listed in core pool or not\n /// @param tokenAddress Address of the asset\n /// @return isAssetListed true if the asset is listed\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\n\n uint256 coreMarketsLength = coreMarkets.length;\n for (uint256 i; i < coreMarketsLength; ) {\n isAssetListed = (VBNB == coreMarkets[i])\n ? (tokenAddress == NATIVE_WRAPPED)\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\n\n if (isAssetListed) {\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev This function checks for the given asset is listed or not\n /// @param comptroller Address of the comptroller\n /// @param asset Address of the asset\n /// @return isListed true if the asset is listed\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\n if (comptroller == CORE_POOL_COMPTROLLER) {\n isListed = isAssetListedInCore(asset);\n } else {\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\n }\n }\n\n /// @dev Get base asset address of the RiskFund\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/TokenConverter/SingleTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\n\n/// @title SingleTokenConverter\n/// @author Venus\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract SingleTokenConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the base asset token\n address public baseAsset;\n\n /// @notice Emitted when base asset is updated\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param baseAsset_ Address of the base asset\n /// @param minAmountToConvert_ Minimum amount to convert\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address baseAsset_,\n uint256 minAmountToConvert_\n ) public initializer {\n _setBaseAsset(baseAsset_);\n\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @notice Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:access Only Governance\n function setBaseAsset(address baseAsset_) external onlyOwner {\n _setBaseAsset(baseAsset_);\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address.\n /// @return balanceLeft Amount of asset, for _privateConversion\n // solhint-disable-next-line\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 balance = token.balanceOf(address(this));\n balanceLeft = balance;\n\n if (asset == baseAsset) {\n balanceLeft = 0;\n token.safeTransfer(destinationAddress, balance);\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\n }\n }\n\n /// @dev Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n /// @custom:event BaseAssetUpdated is emitted on success\n function _setBaseAsset(address baseAsset_) internal {\n ensureNonzeroAddress(baseAsset_);\n emit BaseAssetUpdated(baseAsset, baseAsset_);\n baseAsset = baseAsset_;\n }\n\n /// @dev Get base asset address\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = baseAsset;\n }\n}\n" + }, + "contracts/Utils/ArrayHelpers.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\nfunction sort(uint256[] memory arr, address[] memory addrs) pure {\n if (arr.length > 1) {\n return quickSortDescending(arr, addrs, 0, arr.length - 1);\n }\n}\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\n/// @param left index of first value\n/// @param right index of last value\nfunction quickSortDescending(\n uint256[] memory arr,\n address[] memory addrs,\n uint256 left,\n uint256 right\n) pure {\n if (left >= right) return;\n uint256 p = arr[(left + right) / 2]; // p = the pivot element\n uint256 i = left;\n uint256 j = right;\n while (i < j) {\n while (arr[i] > p) ++i;\n while (arr[j] < p) --j; // arr[j] < p means p still to the right, so j > 0\n if (arr[i] < arr[j]) {\n (arr[i], arr[j]) = (arr[j], arr[i]);\n (addrs[i], addrs[j]) = (addrs[j], addrs[i]);\n } else {\n ++i;\n }\n }\n\n if (j > left) quickSortDescending(arr, addrs, left, j - 1); // j > left, so j > 0\n quickSortDescending(arr, addrs, j + 1, right);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \"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 require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(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 require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(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 require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason 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 // 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\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}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index 8c4e22e7..c7c82d7c 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -191,10 +191,7 @@ const config: HardhatUserConfig = { url: process.env.ARCHIVE_NODE_basesepolia || "https://sepolia.base.org", chainId: 84532, live: true, - // accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], - accounts: { - mnemonic: process.env.MNEMONIC || "", - } + accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], }, }, etherscan: { @@ -209,7 +206,7 @@ const config: HardhatUserConfig = { arbitrumone: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", opsepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", opmainnet: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", - basesepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY" + basesepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", }, customChains: [ { From 53b1670a3d4c4fa4c1116c7e80aa4b7bf0eb5a12 Mon Sep 17 00:00:00 2001 From: web3rover Date: Thu, 14 Nov 2024 10:17:54 +0000 Subject: [PATCH 08/24] feat: updating deployment files --- deployments/basesepolia.json | 2023 ++++++++++++++++++++++++ deployments/basesepolia_addresses.json | 10 + 2 files changed, 2033 insertions(+) create mode 100644 deployments/basesepolia.json create mode 100644 deployments/basesepolia_addresses.json diff --git a/deployments/basesepolia.json b/deployments/basesepolia.json new file mode 100644 index 00000000..833b0646 --- /dev/null +++ b/deployments/basesepolia.json @@ -0,0 +1,2023 @@ +{ + "name": "basesepolia", + "chainId": "84532", + "contracts": { + "DefaultProxyAdmin": { + "address": "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] + }, + "ProtocolShareReserve": { + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "ProtocolShareReserve_Implementation": { + "address": "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_corePoolComptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "_wbnb", + "type": "address" + }, + { + "internalType": "address", + "name": "_vbnb", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, + "ProtocolShareReserve_Proxy": { + "address": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + } + } +} diff --git a/deployments/basesepolia_addresses.json b/deployments/basesepolia_addresses.json new file mode 100644 index 00000000..f3db441a --- /dev/null +++ b/deployments/basesepolia_addresses.json @@ -0,0 +1,10 @@ +{ + "name": "basesepolia", + "chainId": "84532", + "addresses": { + "DefaultProxyAdmin": "0xB85dD19112c4BF1240FeD0f26E8D0b0576a82546", + "ProtocolShareReserve": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73", + "ProtocolShareReserve_Implementation": "0xde1fC9E003c2637E94Da29d55783ce42F1e1f81c", + "ProtocolShareReserve_Proxy": "0x4Ae3D77Ece08Ec3E5f5842B195f746bd3bCb8d73" + } +} From 1eabda1e42cb192b29f74f7a4cc98e677ce2826b Mon Sep 17 00:00:00 2001 From: Venus Tools Date: Mon, 18 Nov 2024 13:42:43 +0000 Subject: [PATCH 09/24] chore(release): 2.5.0-dev.1 [skip ci] ## [2.5.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.4.0...v2.5.0-dev.1) (2024-11-18) ### Features * deployment files for the converter network on arbitrum sepolia ([ebaab0c](https://github.com/VenusProtocol/protocol-reserve/commit/ebaab0cba32baa04da18304861dc5c967341878d)) * deployment files for the converters on the arbitrum sepolia ([3e3c04b](https://github.com/VenusProtocol/protocol-reserve/commit/3e3c04ba91946b66c75bb8915294d844997bd98a)) * deployment files for the xvsvault treasury on arbitrum sepolia ([8ea6e4b](https://github.com/VenusProtocol/protocol-reserve/commit/8ea6e4bf5022f18ba0cd86a6320b52a76c6432a6)) * updating deployment files ([2107500](https://github.com/VenusProtocol/protocol-reserve/commit/21075008d181a7d1d3934fd9f4d123a99067658c)) * updating deployment files ([9054a09](https://github.com/VenusProtocol/protocol-reserve/commit/9054a09a9111b9b32b1f78849743fc762b70cac0)) --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f62980df..97d05276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [2.5.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.4.0...v2.5.0-dev.1) (2024-11-18) + + +### Features + +* deployment files for the converter network on arbitrum sepolia ([ebaab0c](https://github.com/VenusProtocol/protocol-reserve/commit/ebaab0cba32baa04da18304861dc5c967341878d)) +* deployment files for the converters on the arbitrum sepolia ([3e3c04b](https://github.com/VenusProtocol/protocol-reserve/commit/3e3c04ba91946b66c75bb8915294d844997bd98a)) +* deployment files for the xvsvault treasury on arbitrum sepolia ([8ea6e4b](https://github.com/VenusProtocol/protocol-reserve/commit/8ea6e4bf5022f18ba0cd86a6320b52a76c6432a6)) +* updating deployment files ([2107500](https://github.com/VenusProtocol/protocol-reserve/commit/21075008d181a7d1d3934fd9f4d123a99067658c)) +* updating deployment files ([9054a09](https://github.com/VenusProtocol/protocol-reserve/commit/9054a09a9111b9b32b1f78849743fc762b70cac0)) + ## [2.4.0](https://github.com/VenusProtocol/protocol-reserve/compare/v2.3.0...v2.4.0) (2024-10-10) diff --git a/package.json b/package.json index 0524ad7d..a1521d8b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@venusprotocol/protocol-reserve", "description": "Venus Protocol contracts to manage the income generated by the protocol", - "version": "2.4.0", + "version": "2.5.0-dev.1", "author": "Venus", "engines": { "node": ">=18.0.0" From ca8b09c1d9362cd1f6cf038d81c2b40d26a9188b Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 19 Nov 2024 15:22:32 +0530 Subject: [PATCH 10/24] chore: update yarn.lock --- yarn.lock | 54 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/yarn.lock b/yarn.lock index 127922e4..1cdd5d82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3544,7 +3544,42 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/protocol-reserve@^2.0.0, @venusprotocol/protocol-reserve@workspace:.": +"@venusprotocol/protocol-reserve@npm:^1.1.0": + version: 1.5.0 + resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" + dependencies: + "@nomiclabs/hardhat-ethers": ^2.2.3 + "@openzeppelin/contracts": ^4.8.3 + "@openzeppelin/contracts-upgradeable": ^4.8.3 + "@openzeppelin/hardhat-upgrades": ^1.21.0 + "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/solidity-utilities": ^1.3.0 + ethers: ^5.7.0 + hardhat-deploy: ^0.11.14 + module-alias: ^2.2.2 + checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 + languageName: node + linkType: hard + +"@venusprotocol/protocol-reserve@npm:^2.0.0": + version: 2.4.0 + resolution: "@venusprotocol/protocol-reserve@npm:2.4.0" + dependencies: + "@nomiclabs/hardhat-ethers": ^2.2.3 + "@openzeppelin/contracts": ^4.8.3 + "@openzeppelin/contracts-upgradeable": ^4.8.3 + "@openzeppelin/hardhat-upgrades": ^1.21.0 + "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/solidity-utilities": ^2.0.3 + "@venusprotocol/venus-protocol": ^9.1.0 + ethers: ^5.7.0 + hardhat-deploy: ^0.11.14 + module-alias: ^2.2.2 + checksum: 6e5ffa1c458cff073f9b920ab6385d9db0c86ac11d0950fe421a853e709ee12ec0013c6d3e9cb4e50e94f749dcd33e7a515d57828c5aa6f925dee8324e896ee5 + languageName: node + linkType: hard + +"@venusprotocol/protocol-reserve@workspace:.": version: 0.0.0-use.local resolution: "@venusprotocol/protocol-reserve@workspace:." dependencies: @@ -3612,23 +3647,6 @@ __metadata: languageName: unknown linkType: soft -"@venusprotocol/protocol-reserve@npm:^1.1.0": - version: 1.5.0 - resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^1.3.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 - languageName: node - linkType: hard - "@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0": version: 2.0.0 resolution: "@venusprotocol/solidity-utilities@npm:2.0.0" From 88c440ab84be079a7465f0a4cf16950e56f3073c Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 19 Nov 2024 20:33:57 +0530 Subject: [PATCH 11/24] feat: xvs vault treasury on arbitrum one --- deployments/arbitrumone/XVSVaultTreasury.json | 627 ++++++++++++++++ .../XVSVaultTreasury_Implementation.json | 672 ++++++++++++++++++ .../arbitrumone/XVSVaultTreasury_Proxy.json | 281 ++++++++ 3 files changed, 1580 insertions(+) create mode 100644 deployments/arbitrumone/XVSVaultTreasury.json create mode 100644 deployments/arbitrumone/XVSVaultTreasury_Implementation.json create mode 100644 deployments/arbitrumone/XVSVaultTreasury_Proxy.json diff --git a/deployments/arbitrumone/XVSVaultTreasury.json b/deployments/arbitrumone/XVSVaultTreasury.json new file mode 100644 index 00000000..c8126665 --- /dev/null +++ b/deployments/arbitrumone/XVSVaultTreasury.json @@ -0,0 +1,627 @@ +{ + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "FundsTransferredToXVSStore", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVault", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xvsVault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "transactionIndex": 4, + "gasUsed": "2289905", + "logsBloom": "0x00000000000000000000000000000004400000000000000000800000000000000000000000800000002000000000000000000000000000000000000000008000000400000000000000000002000002000001000000000000000000000000000000000000020000400000000000000800000000800800000000000010000000400000001000000000000000000000000000000000000080000000000000800000000400000000001000000001000400000000000000800000000000000200002000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000800000000000000000000000000", + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c", + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "logs": [ + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000001052b6eee137074761ffe040a0357e6f8c80db8d" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 4, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": [ + "0x3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000008b79692aab2822be30a6382eb04763a74752d5b4" + ], + "data": "0x", + "logIndex": 5, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 6, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6ff3e9459227f0cde8b102b90be25960317b216", + "logIndex": 7, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + } + ], + "blockNumber": 276068086, + "cumulativeGasUsed": "2732143", + "status": 1, + "byzantium": true + }, + "args": [ + "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", + "0x485cc955000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b1570000000000000000000000008b79692aab2822be30a6382eb04763a74752d5b4" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": ["0xD9dD18EB0cf10CbA837677f28A8F9Bda4bc2b157", "0x8b79692AAB2822Be30a6382Eb04763A74752d5B4"] + }, + "implementation": "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/XVSVaultTreasury_Implementation.json b/deployments/arbitrumone/XVSVaultTreasury_Implementation.json new file mode 100644 index 00000000..7348ad67 --- /dev/null +++ b/deployments/arbitrumone/XVSVaultTreasury_Implementation.json @@ -0,0 +1,672 @@ +{ + "address": "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "xvsAddress_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "FundsTransferredToXVSStore", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldXVSVault", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "xvsVault", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xea109759746246e6c186cb5c6c0e1b9031a92069667ed92fa20ebbc0df03ae5d", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "transactionIndex": 4, + "gasUsed": "2986548", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000080000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000", + "blockHash": "0x413c74e534fa398b24b652d66a0c39894ccaab1db5c10baaa62de56a15f09ca1", + "transactionHash": "0xea109759746246e6c186cb5c6c0e1b9031a92069667ed92fa20ebbc0df03ae5d", + "logs": [ + { + "transactionIndex": 4, + "blockNumber": 276068069, + "transactionHash": "0xea109759746246e6c186cb5c6c0e1b9031a92069667ed92fa20ebbc0df03ae5d", + "address": "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 6, + "blockHash": "0x413c74e534fa398b24b652d66a0c39894ccaab1db5c10baaa62de56a15f09ca1" + } + ], + "blockNumber": 276068069, + "cumulativeGasUsed": "4169696", + "status": 1, + "byzantium": true + }, + "args": ["0xc1Eb7689147C81aC840d4FF0D298489fc7986d52"], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"xvsAddress_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InsufficientBalance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"xvsStore\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountMantissa\",\"type\":\"uint256\"}],\"name\":\"FundsTransferredToXVSStore\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldXVSVault\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newXVSVault\",\"type\":\"address\"}],\"name\":\"XVSVaultUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"XVS_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountMantissa\",\"type\":\"uint256\"}],\"name\":\"fundXVSVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"xvsVault_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"xvsVault_\",\"type\":\"address\"}],\"name\":\"setXVSVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"xvsVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\",\"params\":{\"xvsAddress_\":\"XVS token address\"}},\"fundXVSVault(uint256)\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"InsufficientBalance is thrown when amount entered is greater than balance\",\"custom:event\":\"FundsTransferredToXVSStore emits on success\",\"params\":{\"amountMantissa\":\"Amount to be sent to XVS vault\"}},\"initialize(address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when XVS vault address is zero\",\"custom:event\":\"XVSVaultUpdated emits on success\",\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"xvsVault_\":\"XVSVault address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setXVSVault(address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when XVS vault address is zero\",\"custom:event\":\"XVSVaultUpdated emits on success\",\"details\":\"XVS vault setter\",\"params\":{\"xvsVault_\":\"Address of the XVS vault\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zeroZeroValueNotAllowed is thrown when amount is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"Amount need to sweep from the contract\",\"to\":\"Address to which assets will be transferred\",\"tokenAddress\":\"Address of the asset(token)\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"stateVariables\":{\"XVS_ADDRESS\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"title\":\"XVSVaultTreasury\",\"version\":1},\"userdoc\":{\"errors\":{\"InsufficientBalance()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"FundsTransferredToXVSStore(address,uint256)\":{\"notice\":\"Emitted when funds transferred to XVSStore address\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"},\"XVSVaultUpdated(address,address)\":{\"notice\":\"Emitted when XVS vault address is updated\"}},\"kind\":\"user\",\"methods\":{\"XVS_ADDRESS()\":{\"notice\":\"The xvs token address\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"fundXVSVault(uint256)\":{\"notice\":\"This function transfers funds to the XVS vault\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"Function to sweep tokens from the contract\"},\"xvsVault()\":{\"notice\":\"The xvsvault address\"}},\"notice\":\"XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProtocolReserve/XVSVaultTreasury.sol\":\"XVSVaultTreasury\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\\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\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\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 cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IXVSVault.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\n/// @title IXVSVaultProxy\\n/// @author Venus\\n/// @notice Interface implemented by `XVSVault`.\\ninterface IXVSVault {\\n function xvsStore() external view returns (address);\\n}\\n\",\"keccak256\":\"0x1d43ccb525a08929eccdd6e3f256ca38b1f8a4bcba290661c72f4e564fd0f1db\",\"license\":\"BSD-3-Clause\"},\"contracts/ProtocolReserve/XVSVaultTreasury.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { IXVSVault } from \\\"../Interfaces/IXVSVault.sol\\\";\\n\\n/// @title XVSVaultTreasury\\n/// @author Venus\\n/// @notice XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract XVSVaultTreasury is AccessControlledV8, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice The xvs token address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable XVS_ADDRESS;\\n\\n /// @notice The xvsvault address\\n address public xvsVault;\\n\\n /// @notice Emitted when XVS vault address is updated\\n event XVSVaultUpdated(address indexed oldXVSVault, address indexed newXVSVault);\\n\\n /// @notice Emitted when funds transferred to XVSStore address\\n event FundsTransferredToXVSStore(address indexed xvsStore, uint256 amountMantissa);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientBalance();\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n /// @param xvsAddress_ XVS token address\\n constructor(address xvsAddress_) {\\n ensureNonzeroAddress(xvsAddress_);\\n XVS_ADDRESS = xvsAddress_;\\n\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param xvsVault_ XVSVault address\\n /// @custom:event XVSVaultUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\\n function initialize(address accessControlManager_, address xvsVault_) public initializer {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n _setXVSVault(xvsVault_);\\n }\\n\\n /// @dev XVS vault setter\\n /// @param xvsVault_ Address of the XVS vault\\n /// @custom:event XVSVaultUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\\n function setXVSVault(address xvsVault_) external onlyOwner {\\n _setXVSVault(xvsVault_);\\n }\\n\\n /// @notice This function transfers funds to the XVS vault\\n /// @param amountMantissa Amount to be sent to XVS vault\\n /// @custom:event FundsTransferredToXVSStore emits on success\\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\\n /// @custom:access Restricted by ACM\\n function fundXVSVault(uint256 amountMantissa) external nonReentrant {\\n _checkAccessAllowed(\\\"fundXVSVault(uint256)\\\");\\n ensureNonzeroValue(amountMantissa);\\n\\n uint256 balance = IERC20Upgradeable(XVS_ADDRESS).balanceOf(address(this));\\n\\n if (balance < amountMantissa) {\\n revert InsufficientBalance();\\n }\\n\\n address xvsStore = IXVSVault(xvsVault).xvsStore();\\n ensureNonzeroAddress(xvsStore);\\n IERC20Upgradeable(XVS_ADDRESS).safeTransfer(xvsStore, amountMantissa);\\n\\n emit FundsTransferredToXVSStore(xvsStore, amountMantissa);\\n }\\n\\n /// @notice Function to sweep tokens from the contract\\n /// @param tokenAddress Address of the asset(token)\\n /// @param to Address to which assets will be transferred\\n /// @param amount Amount need to sweep from the contract\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @dev XVS vault setter\\n /// @param xvsVault_ Address of the XVS vault\\n /// @custom:event XVSVaultUpdated emits on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\\n function _setXVSVault(address xvsVault_) internal {\\n ensureNonzeroAddress(xvsVault_);\\n emit XVSVaultUpdated(xvsVault, xvsVault_);\\n xvsVault = xvsVault_;\\n }\\n}\\n\",\"keccak256\":\"0x9f2e4ebeb5ece0031ac34bceac4386dbab16cac5f93faf211985d0efaa7811ab\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b5060405161175938038061175983398101604081905261002f9161013c565b61003881610053565b6001600160a01b03811660805261004d61007d565b5061016c565b6001600160a01b03811661007a576040516342bcdf7f60e11b815260040160405180910390fd5b50565b600054610100900460ff16156100e95760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161461013a576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60006020828403121561014e57600080fd5b81516001600160a01b038116811461016557600080fd5b9392505050565b6080516115c46101956000396000818161016d015281816105d3015261074801526115c46000f3fe608060405234801561001057600080fd5b50600436106100df5760003560e01c8063715018a61161008c5780639a02c39a116100665780639a02c39a146101d0578063b4a0bdf3146101e3578063e30c397814610201578063f2fde38b1461021f57600080fd5b8063715018a6146101a257806379ba5097146101aa5780638da5cb5b146101b257600080fd5b8063485cc955116100bd578063485cc9551461015557806354a617ed1461016857806364aff9ec1461018f57600080fd5b80630e32cb86146100e457806314d35a63146100f95780631b9ce5751461010c575b600080fd5b6100f76100f2366004611371565b610232565b005b6100f7610107366004611371565b610246565b60fb5461012c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100f7610163366004611395565b610257565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6100f761019d3660046113ce565b6103e8565b6100f76104a7565b6100f76104bb565b60335473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f76101de36600461140f565b610553565b60975473ffffffffffffffffffffffffffffffffffffffff1661012c565b60655473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f761022d366004611371565b6107cb565b61023a61087b565b610243816108e2565b50565b61024e61087b565b610243816109f1565b600054610100900460ff16158080156102775750600054600160ff909116105b806102915750303b158015610291575060005460ff166001145b6103085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61036f83610a88565b610377610b16565b610380826109f1565b80156103e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6103f061087b565b6103f8610b9b565b61040183610bf4565b61040a82610bf4565b61041381610c41565b8261043573ffffffffffffffffffffffffffffffffffffffff82168484610c7b565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d58460405161049491815260200190565b60405180910390a3506103e3600160c955565b6104af61087b565b6104b96000610d0f565b565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461054a5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016102ff565b61024381610d0f565b61055b610b9b565b6105996040518060400160405280601581526020017f66756e645856535661756c742875696e74323536290000000000000000000000815250610d40565b6105a281610c41565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561062f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106539190611428565b90508181101561068f576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb54604080517f24f52bbf000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916324f52bbf9160048083019260209291908290030181865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107239190611441565b905061072e81610bf4565b61076f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168285610c7b565b8073ffffffffffffffffffffffffffffffffffffffff167f15daab32014613a1f6e3f4500519c6ae9f7b172530faeac09157815d4f395381846040516107b791815260200190565b60405180910390a25050610243600160c955565b6107d361087b565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561083660335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60335473ffffffffffffffffffffffffffffffffffffffff1633146104b95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ff565b73ffffffffffffffffffffffffffffffffffffffff811661096b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016102ff565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b6109fa81610bf4565b60fb5460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a90600090a360fb80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16610b055760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b610b0d610e1d565b61024381610ea2565b600054610100900460ff16610b935760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9610f1f565b600260c95403610bed5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ff565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610243576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003610243576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526103e3908490610f9c565b600160c955565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561024381611091565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab90610d9990339086906004016114cc565b602060405180830381865afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906114fb565b905080610e19573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016102ff9392919061151d565b5050565b600054610100900460ff16610e9a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9611108565b600054610100900460ff1661023a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b600054610100900460ff16610d085760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6000610ffe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661118e9092919063ffffffff16565b905080516000148061101f57508080602001905181019061101f91906114fb565b6103e35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102ff565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166111855760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b933610d0f565b606061119d84846000856111a5565b949350505050565b60608247101561121d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102ff565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611246919061155f565b60006040518083038185875af1925050503d8060008114611283576040519150601f19603f3d011682016040523d82523d6000602084013e611288565b606091505b5091509150611299878383876112a4565b979650505050505050565b606083156113205782516000036113195773ffffffffffffffffffffffffffffffffffffffff85163b6113195760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102ff565b508161119d565b61119d83838151156113355781518083602001fd5b8060405162461bcd60e51b81526004016102ff919061157b565b73ffffffffffffffffffffffffffffffffffffffff8116811461024357600080fd5b60006020828403121561138357600080fd5b813561138e8161134f565b9392505050565b600080604083850312156113a857600080fd5b82356113b38161134f565b915060208301356113c38161134f565b809150509250929050565b6000806000606084860312156113e357600080fd5b83356113ee8161134f565b925060208401356113fe8161134f565b929592945050506040919091013590565b60006020828403121561142157600080fd5b5035919050565b60006020828403121561143a57600080fd5b5051919050565b60006020828403121561145357600080fd5b815161138e8161134f565b60005b83811015611479578181015183820152602001611461565b50506000910152565b6000815180845261149a81602086016020860161145e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061119d6040830184611482565b60006020828403121561150d57600080fd5b8151801515811461138e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526115566060830184611482565b95945050505050565b6000825161157181846020870161145e565b9190910192915050565b60208152600061138e602083018461148256fea26469706673582212203c97736c79eecd2598b8f7c00cad09d14a710f0a7649e22c0559ee40d7a25f1264736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100df5760003560e01c8063715018a61161008c5780639a02c39a116100665780639a02c39a146101d0578063b4a0bdf3146101e3578063e30c397814610201578063f2fde38b1461021f57600080fd5b8063715018a6146101a257806379ba5097146101aa5780638da5cb5b146101b257600080fd5b8063485cc955116100bd578063485cc9551461015557806354a617ed1461016857806364aff9ec1461018f57600080fd5b80630e32cb86146100e457806314d35a63146100f95780631b9ce5751461010c575b600080fd5b6100f76100f2366004611371565b610232565b005b6100f7610107366004611371565b610246565b60fb5461012c9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100f7610163366004611395565b610257565b61012c7f000000000000000000000000000000000000000000000000000000000000000081565b6100f761019d3660046113ce565b6103e8565b6100f76104a7565b6100f76104bb565b60335473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f76101de36600461140f565b610553565b60975473ffffffffffffffffffffffffffffffffffffffff1661012c565b60655473ffffffffffffffffffffffffffffffffffffffff1661012c565b6100f761022d366004611371565b6107cb565b61023a61087b565b610243816108e2565b50565b61024e61087b565b610243816109f1565b600054610100900460ff16158080156102775750600054600160ff909116105b806102915750303b158015610291575060005460ff166001145b6103085760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084015b60405180910390fd5b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561036657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61036f83610a88565b610377610b16565b610380826109f1565b80156103e357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b6103f061087b565b6103f8610b9b565b61040183610bf4565b61040a82610bf4565b61041381610c41565b8261043573ffffffffffffffffffffffffffffffffffffffff82168484610c7b565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d58460405161049491815260200190565b60405180910390a3506103e3600160c955565b6104af61087b565b6104b96000610d0f565b565b606554339073ffffffffffffffffffffffffffffffffffffffff16811461054a5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084016102ff565b61024381610d0f565b61055b610b9b565b6105996040518060400160405280601581526020017f66756e645856535661756c742875696e74323536290000000000000000000000815250610d40565b6105a281610c41565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561062f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106539190611428565b90508181101561068f576040517ff4d678b800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb54604080517f24f52bbf000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916324f52bbf9160048083019260209291908290030181865afa1580156106ff573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107239190611441565b905061072e81610bf4565b61076f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168285610c7b565b8073ffffffffffffffffffffffffffffffffffffffff167f15daab32014613a1f6e3f4500519c6ae9f7b172530faeac09157815d4f395381846040516107b791815260200190565b60405180910390a25050610243600160c955565b6107d361087b565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116811790915561083660335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60335473ffffffffffffffffffffffffffffffffffffffff1633146104b95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102ff565b73ffffffffffffffffffffffffffffffffffffffff811661096b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016102ff565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b6109fa81610bf4565b60fb5460405173ffffffffffffffffffffffffffffffffffffffff8084169216907f3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a90600090a360fb80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16610b055760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b610b0d610e1d565b61024381610ea2565b600054610100900460ff16610b935760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9610f1f565b600260c95403610bed5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016102ff565b600260c955565b73ffffffffffffffffffffffffffffffffffffffff8116610243576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600003610243576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526103e3908490610f9c565b600160c955565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561024381611091565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab90610d9990339086906004016114cc565b602060405180830381865afa158015610db6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dda91906114fb565b905080610e19573330836040517f4a3fa2930000000000000000000000000000000000000000000000000000000081526004016102ff9392919061151d565b5050565b600054610100900460ff16610e9a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b9611108565b600054610100900460ff1661023a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b600054610100900460ff16610d085760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6000610ffe826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661118e9092919063ffffffff16565b905080516000148061101f57508080602001905181019061101f91906114fb565b6103e35760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016102ff565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166111855760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016102ff565b6104b933610d0f565b606061119d84846000856111a5565b949350505050565b60608247101561121d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016102ff565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611246919061155f565b60006040518083038185875af1925050503d8060008114611283576040519150601f19603f3d011682016040523d82523d6000602084013e611288565b606091505b5091509150611299878383876112a4565b979650505050505050565b606083156113205782516000036113195773ffffffffffffffffffffffffffffffffffffffff85163b6113195760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102ff565b508161119d565b61119d83838151156113355781518083602001fd5b8060405162461bcd60e51b81526004016102ff919061157b565b73ffffffffffffffffffffffffffffffffffffffff8116811461024357600080fd5b60006020828403121561138357600080fd5b813561138e8161134f565b9392505050565b600080604083850312156113a857600080fd5b82356113b38161134f565b915060208301356113c38161134f565b809150509250929050565b6000806000606084860312156113e357600080fd5b83356113ee8161134f565b925060208401356113fe8161134f565b929592945050506040919091013590565b60006020828403121561142157600080fd5b5035919050565b60006020828403121561143a57600080fd5b5051919050565b60006020828403121561145357600080fd5b815161138e8161134f565b60005b83811015611479578181015183820152602001611461565b50506000910152565b6000815180845261149a81602086016020860161145e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600061119d6040830184611482565b60006020828403121561150d57600080fd5b8151801515811461138e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff8086168352808516602084015250606060408301526115566060830184611482565b95945050505050565b6000825161157181846020870161145e565b9190910192915050565b60208152600061138e602083018461148256fea26469706673582212203c97736c79eecd2598b8f7c00cad09d14a710f0a7649e22c0559ee40d7a25f1264736f6c63430008190033", + "devdoc": { + "author": "Venus", + "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor", + "params": { + "xvsAddress_": "XVS token address" + } + }, + "fundXVSVault(uint256)": { + "custom:access": "Restricted by ACM", + "custom:error": "InsufficientBalance is thrown when amount entered is greater than balance", + "custom:event": "FundsTransferredToXVSStore emits on success", + "params": { + "amountMantissa": "Amount to be sent to XVS vault" + } + }, + "initialize(address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when XVS vault address is zero", + "custom:event": "XVSVaultUpdated emits on success", + "params": { + "accessControlManager_": "Access control manager contract address", + "xvsVault_": "XVSVault address" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setXVSVault(address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when XVS vault address is zero", + "custom:event": "XVSVaultUpdated emits on success", + "details": "XVS vault setter", + "params": { + "xvsVault_": "Address of the XVS vault" + } + }, + "sweepToken(address,address,uint256)": { + "custom:access": "Only Governance", + "custom:error": "ZeroAddressNotAllowed is thrown when tokenAddress/to address is zeroZeroValueNotAllowed is thrown when amount is zero", + "custom:event": "Emits SweepToken event on success", + "params": { + "amount": "Amount need to sweep from the contract", + "to": "Address to which assets will be transferred", + "tokenAddress": "Address of the asset(token)" + } + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + } + }, + "stateVariables": { + "XVS_ADDRESS": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + } + }, + "title": "XVSVaultTreasury", + "version": 1 + }, + "userdoc": { + "errors": { + "InsufficientBalance()": [ + { + "notice": "Thrown when given input amount is zero" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ], + "ZeroValueNotAllowed()": [ + { + "notice": "Thrown if the supplied value is 0 where it is not allowed" + } + ] + }, + "events": { + "FundsTransferredToXVSStore(address,uint256)": { + "notice": "Emitted when funds transferred to XVSStore address" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + }, + "SweepToken(address,address,uint256)": { + "notice": "Event emitted when tokens are swept" + }, + "XVSVaultUpdated(address,address)": { + "notice": "Emitted when XVS vault address is updated" + } + }, + "kind": "user", + "methods": { + "XVS_ADDRESS()": { + "notice": "The xvs token address" + }, + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "fundXVSVault(uint256)": { + "notice": "This function transfers funds to the XVS vault" + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "sweepToken(address,address,uint256)": { + "notice": "Function to sweep tokens from the contract" + }, + "xvsVault()": { + "notice": "The xvsvault address" + } + }, + "notice": "XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 547, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "_status", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 616, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 8748, + "contract": "contracts/ProtocolReserve/XVSVaultTreasury.sol:XVSVaultTreasury", + "label": "xvsVault", + "offset": 0, + "slot": "251", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/arbitrumone/XVSVaultTreasury_Proxy.json b/deployments/arbitrumone/XVSVaultTreasury_Proxy.json new file mode 100644 index 00000000..d8ea03f1 --- /dev/null +++ b/deployments/arbitrumone/XVSVaultTreasury_Proxy.json @@ -0,0 +1,281 @@ +{ + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "transactionIndex": 4, + "gasUsed": "2289905", + "logsBloom": "0x00000000000000000000000000000004400000000000000000800000000000000000000000800000002000000000000000000000000000000000000000008000000400000000000000000002000002000001000000000000000000000000000000000000020000400000000000000800000000800800000000000010000000400000001000000000000000000000000000000000000080000000000000800000000400000000001000000001000400000000000000800000000000000200002000000020000000000000000000040000000000000400000000000000000020000000000000000000000000000000000000000800000000000000000000000000", + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c", + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "logs": [ + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000001052b6eee137074761ffe040a0357e6f8c80db8d" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 4, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": [ + "0x3bf9abe00ba7558b8031adf12ba72290510a001068b251cd4931a4199a78068a", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000008b79692aab2822be30a6382eb04763a74752d5b4" + ], + "data": "0x", + "logIndex": 5, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 6, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + }, + { + "transactionIndex": 4, + "blockNumber": 276068086, + "transactionHash": "0x6e41ba2f7ddaa88084664582bee6dcafdef1972bb66b4bbb0beefded324d583d", + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6ff3e9459227f0cde8b102b90be25960317b216", + "logIndex": 7, + "blockHash": "0x40bd5b51e63e2f01dc244365c7d07c3b17c130b378eddd3a9a479ce2a7bb6a0c" + } + ], + "blockNumber": 276068086, + "cumulativeGasUsed": "2732143", + "status": 1, + "byzantium": true + }, + "args": [ + "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", + "0x485cc955000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b1570000000000000000000000008b79692aab2822be30a6382eb04763a74752d5b4" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} From e0397f005b0f68afbe91b58518a34f06177f6fa9 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 19 Nov 2024 20:34:34 +0530 Subject: [PATCH 12/24] feat: converters deployment files on arbitrum one --- deploy/004-single-token-converter.ts | 7 + .../SingleTokenConverterBeacon.json | 206 ++ .../arbitrumone/SingleTokenConverterImp.json | 2170 +++++++++++++++++ .../arbitrumone/USDCPrimeConverter.json | 229 ++ .../arbitrumone/USDTPrimeConverter.json | 229 ++ .../arbitrumone/WBTCPrimeConverter.json | 229 ++ .../arbitrumone/WETHPrimeConverter.json | 229 ++ .../arbitrumone/XVSVaultConverter.json | 229 ++ .../027aeec938943227f90cf24126ba2c44.json | 280 +++ 9 files changed, 3808 insertions(+) create mode 100644 deployments/arbitrumone/SingleTokenConverterBeacon.json create mode 100644 deployments/arbitrumone/SingleTokenConverterImp.json create mode 100644 deployments/arbitrumone/USDCPrimeConverter.json create mode 100644 deployments/arbitrumone/USDTPrimeConverter.json create mode 100644 deployments/arbitrumone/WBTCPrimeConverter.json create mode 100644 deployments/arbitrumone/WETHPrimeConverter.json create mode 100644 deployments/arbitrumone/XVSVaultConverter.json create mode 100644 deployments/arbitrumone/solcInputs/027aeec938943227f90cf24126ba2c44.json diff --git a/deploy/004-single-token-converter.ts b/deploy/004-single-token-converter.ts index 6af25f85..b70fb009 100644 --- a/deploy/004-single-token-converter.ts +++ b/deploy/004-single-token-converter.ts @@ -47,6 +47,13 @@ async function getBaseAssets(network: string): Promise { WETHPrimeConverter: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", // WETH on arbitrum sepolia XVSVaultConverter: "0x877Dc896e7b13096D3827872e396927BbE704407", // XVS on arbitrum sepolia }, + arbitrumone: { + USDTPrimeConverter: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9", // USDT on arbitrum one + USDCPrimeConverter: "0xaf88d065e77c8cc2239327c5edb3a432268e5831", // USDC on arbitrum one + WBTCPrimeConverter: "0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f", // WBTC on arbitrum one + WETHPrimeConverter: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", // WETH on arbitrum one + XVSVaultConverter: "0xc1Eb7689147C81aC840d4FF0D298489fc7986d52", // XVS on arbitrum one + }, // add more networks }; return networkBaseAssets[network]; diff --git a/deployments/arbitrumone/SingleTokenConverterBeacon.json b/deployments/arbitrumone/SingleTokenConverterBeacon.json new file mode 100644 index 00000000..b18ed67c --- /dev/null +++ b/deployments/arbitrumone/SingleTokenConverterBeacon.json @@ -0,0 +1,206 @@ +{ + "address": "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xa536edbf52d94a306624826086f88bdbfff83366266ee77992d193fd52eb68d9", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "transactionIndex": 9, + "gasUsed": "933064", + "logsBloom": "0x000000000000000000000000000000040000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000a0000000000000000000800000000000000000000000010000000400000020000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000040000000000000000000000000000000000000000000", + "blockHash": "0x002343b49de691863e818d22a278265bd466a9be1ceb6c65af10dc56d22de554", + "transactionHash": "0xa536edbf52d94a306624826086f88bdbfff83366266ee77992d193fd52eb68d9", + "logs": [ + { + "transactionIndex": 9, + "blockNumber": 276068970, + "transactionHash": "0xa536edbf52d94a306624826086f88bdbfff83366266ee77992d193fd52eb68d9", + "address": "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x002343b49de691863e818d22a278265bd466a9be1ceb6c65af10dc56d22de554" + } + ], + "blockNumber": 276068970, + "cumulativeGasUsed": "2686251", + "status": 1, + "byzantium": true + }, + "args": ["0x07801d54906Be49517DfDEd26c89A81fb94e504B"], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their implementation contract, which is where they will delegate all function calls. An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\",\"events\":{\"Upgraded(address)\":{\"details\":\"Emitted when the implementation returned by the beacon is changed.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the beacon.\"},\"implementation()\":{\"details\":\"Returns the current implementation address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"upgradeTo(address)\":{\"details\":\"Upgrades the beacon to a new implementation. Emits an {Upgraded} event. Requirements: - msg.sender must be the owner of the contract. - `newImplementation` must be a contract.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\":\"UpgradeableBeacon\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../../access/Ownable.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\\n * implementation contract, which is where they will delegate all function calls.\\n *\\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\\n */\\ncontract UpgradeableBeacon is IBeacon, Ownable {\\n address private _implementation;\\n\\n /**\\n * @dev Emitted when the implementation returned by the beacon is changed.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\\n * beacon.\\n */\\n constructor(address implementation_) {\\n _setImplementation(implementation_);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function implementation() public view virtual override returns (address) {\\n return _implementation;\\n }\\n\\n /**\\n * @dev Upgrades the beacon to a new implementation.\\n *\\n * Emits an {Upgraded} event.\\n *\\n * Requirements:\\n *\\n * - msg.sender must be the owner of the contract.\\n * - `newImplementation` must be a contract.\\n */\\n function upgradeTo(address newImplementation) public virtual onlyOwner {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Sets the implementation contract address for this beacon\\n *\\n * Requirements:\\n *\\n * - `newImplementation` must be a contract.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"UpgradeableBeacon: implementation is not a contract\\\");\\n _implementation = newImplementation;\\n }\\n}\\n\",\"keccak256\":\"0x6ec71aef5659f3f74011169948d2fcda8c6599be5bb38f986380a8737f96cc0f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b506040516105ef3803806105ef83398101604081905261002f9161013a565b61003833610047565b61004181610097565b5061016a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381163b6101185760405162461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561014c57600080fd5b81516001600160a01b038116811461016357600080fd5b9392505050565b610476806101796000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100c45780638da5cb5b146100cc578063f2fde38b146100ea57600080fd5b80633659cfe61461006c5780635c60da1b14610081575b600080fd5b61007f61007a366004610403565b6100fd565b005b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61007f610152565b60005473ffffffffffffffffffffffffffffffffffffffff1661009b565b61007f6100f8366004610403565b610166565b610105610222565b61010e816102a3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61015a610222565b610164600061038e565b565b61016e610222565b73ffffffffffffffffffffffffffffffffffffffff8116610216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61021f8161038e565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020d565b73ffffffffffffffffffffffffffffffffffffffff81163b610347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840161020d565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561041557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461043957600080fd5b939250505056fea26469706673582212207c5035dbfc7adb0300f7d91a2c50e4c557af8518a6a5d1ce5b27b7dcd82f6a9364736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063715018a611610050578063715018a6146100c45780638da5cb5b146100cc578063f2fde38b146100ea57600080fd5b80633659cfe61461006c5780635c60da1b14610081575b600080fd5b61007f61007a366004610403565b6100fd565b005b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61007f610152565b60005473ffffffffffffffffffffffffffffffffffffffff1661009b565b61007f6100f8366004610403565b610166565b610105610222565b61010e816102a3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61015a610222565b610164600061038e565b565b61016e610222565b73ffffffffffffffffffffffffffffffffffffffff8116610216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61021f8161038e565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161020d565b73ffffffffffffffffffffffffffffffffffffffff81163b610347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e747261637400000000000000000000000000606482015260840161020d565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561041557600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461043957600080fd5b939250505056fea26469706673582212207c5035dbfc7adb0300f7d91a2c50e4c557af8518a6a5d1ce5b27b7dcd82f6a9364736f6c63430008190033", + "devdoc": { + "details": "This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their implementation contract, which is where they will delegate all function calls. An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.", + "events": { + "Upgraded(address)": { + "details": "Emitted when the implementation returned by the beacon is changed." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the beacon." + }, + "implementation()": { + "details": "Returns the current implementation address." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "upgradeTo(address)": { + "details": "Upgrades the beacon to a new implementation. Emits an {Upgraded} event. Requirements: - msg.sender must be the owner of the contract. - `newImplementation` must be a contract." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1876, + "contract": "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol:UpgradeableBeacon", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2493, + "contract": "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol:UpgradeableBeacon", + "label": "_implementation", + "offset": 0, + "slot": "1", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} diff --git a/deployments/arbitrumone/SingleTokenConverterImp.json b/deployments/arbitrumone/SingleTokenConverterImp.json new file mode 100644 index 00000000..951d0d49 --- /dev/null +++ b/deployments/arbitrumone/SingleTokenConverterImp.json @@ -0,0 +1,2170 @@ +{ + "address": "0x07801d54906Be49517DfDEd26c89A81fb94e504B", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + } + ], + "name": "AmountInHigherThanMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountInMismatched", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + } + ], + "name": "AmountOutLowerThanMinRequired", + "type": "error" + }, + { + "inputs": [], + "name": "AmountOutMismatched", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionConfigNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionEnabledOnlyForPrivateConversions", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensActive", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensPaused", + "type": "error" + }, + { + "inputs": [], + "name": "DeflationaryTokenNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxIncentive", + "type": "uint256" + } + ], + "name": "IncentiveTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMisMatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", + "type": "error" + }, + { + "inputs": [], + "name": "NonZeroIncentiveForPrivateConversion", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetTransferredToDestination", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldBaseAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newBaseAsset", + "type": "address" + } + ], + "name": "BaseAssetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" + } + ], + "name": "ConversionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "converterNetwork", + "type": "address" + } + ], + "name": "ConverterNetworkAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", + "type": "address" + } + ], + "name": "DestinationAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinAmountToConvert", + "type": "uint256" + } + ], + "name": "MinAmountToConvertUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_INCENTIVE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseAsset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "conversionConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "conversionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "converterNetwork", + "outputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "destinationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + }, + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + }, + { + "internalType": "address", + "name": "baseAsset_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceOracle", + "outputs": [ + { + "internalType": "contract ResilientOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baseAsset_", + "type": "address" + } + ], + "name": "setBaseAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" + } + ], + "name": "setConversionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" + } + ], + "name": "setConversionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", + "type": "address" + } + ], + "name": "setConverterNetwork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + } + ], + "name": "setDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "setMinAmountToConvert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xcee6d5a2446e8b44e1034454917a855d6e62858ee5ccf5d8d4abea9817f0eb60", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x07801d54906Be49517DfDEd26c89A81fb94e504B", + "transactionIndex": 1, + "gasUsed": "8021070", + "logsBloom": "0x00000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000008000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000", + "blockHash": "0x1d83199a4d6697a5313e1c9f59072293859a9eee450a381e842f5c7f85c2b343", + "transactionHash": "0xcee6d5a2446e8b44e1034454917a855d6e62858ee5ccf5d8d4abea9817f0eb60", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 276068941, + "transactionHash": "0xcee6d5a2446e8b44e1034454917a855d6e62858ee5ccf5d8d4abea9817f0eb60", + "address": "0x07801d54906Be49517DfDEd26c89A81fb94e504B", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0x1d83199a4d6697a5313e1c9f59072293859a9eee450a381e842f5c7f85c2b343" + } + ], + "blockNumber": 276068941, + "cumulativeGasUsed": "8021070", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountInHigherThanMax\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountInMismatched\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"}],\"name\":\"AmountOutLowerThanMinRequired\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountOutMismatched\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionConfigNotEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionEnabledOnlyForPrivateConversions\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensActive\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConversionTokensPaused\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeflationaryTokenNotSupported\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxIncentive\",\"type\":\"uint256\"}],\"name\":\"IncentiveTooHigh\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputLengthMisMatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientInputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientOutputAmount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientPoolLiquidity\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidConverterNetwork\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidMinimumAmountToConvert\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidToAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConfigAddresses\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NonZeroIncentiveForPrivateConversion\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetTransferredToDestination\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldBaseAsset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newBaseAsset\",\"type\":\"address\"}],\"name\":\"BaseAssetUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newIncentive\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"oldAccess\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"newAccess\",\"type\":\"uint8\"}],\"name\":\"ConversionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionPaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ConversionResumed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"name\":\"ConvertedForExactTokensSupportingFeeOnTransferTokens\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldConverterNetwork\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converterNetwork\",\"type\":\"address\"}],\"name\":\"ConverterNetworkAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldDestinationAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destinationAddress\",\"type\":\"address\"}],\"name\":\"DestinationAddressUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMinAmountToConvert\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMinAmountToConvert\",\"type\":\"uint256\"}],\"name\":\"MinAmountToConvertUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"oldPriceOracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle\",\"type\":\"address\"}],\"name\":\"PriceOracleUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"SweepToken\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"MAX_INCENTIVE\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenBalance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"baseAsset\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"conversionConfigurations\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"conversionPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMaxMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"convertForExactTokensSupportingFeeOnTransferTokens\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"actualAmountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"actualAmountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"converterNetwork\",\"outputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"destinationAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountIn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amountInMantissa\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"}],\"name\":\"getUpdatedAmountOut\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountConvertedMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMantissa\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"},{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minAmountToConvert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauseConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOracle\",\"outputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"resumeConversion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"baseAsset_\",\"type\":\"address\"}],\"name\":\"setBaseAsset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddressOut\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig\",\"name\":\"conversionConfig\",\"type\":\"tuple\"}],\"name\":\"setConversionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"tokenAddressesOut\",\"type\":\"address[]\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"incentive\",\"type\":\"uint256\"},{\"internalType\":\"enum IAbstractTokenConverter.ConversionAccessibility\",\"name\":\"conversionAccess\",\"type\":\"uint8\"}],\"internalType\":\"struct IAbstractTokenConverter.ConversionConfig[]\",\"name\":\"conversionConfigs\",\"type\":\"tuple[]\"}],\"name\":\"setConversionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IConverterNetwork\",\"name\":\"converterNetwork_\",\"type\":\"address\"}],\"name\":\"setConverterNetwork\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destinationAddress_\",\"type\":\"address\"}],\"name\":\"setDestination\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"minAmountToConvert_\",\"type\":\"uint256\"}],\"name\":\"setMinAmountToConvert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract ResilientOracle\",\"name\":\"priceOracle_\",\"type\":\"address\"}],\"name\":\"setPriceOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"sweepToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"balanceOf(address)\":{\"params\":{\"tokenAddress\":\"Address of the token\"},\"returns\":{\"tokenBalance\":\"Balance of the token the contract has\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\",\"custom:event\":\"Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"amountOutMinMantissa\":\"Min amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\",\"custom:event\":\"Emits ConvertedForExactTokens event on success\",\"details\":\"Method does not support deflationary tokens transfer\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\",\"custom:event\":\"Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\",\"params\":{\"amountInMaxMantissa\":\"Max amount of tokenAddressIn\",\"amountOutMantissa\":\"Amount of tokenAddressOut required as output\",\"to\":\"Address of the tokenAddressOut receiver\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"actualAmountIn\":\"Actual amount transferred to destination\",\"actualAmountOut\":\"Actual amount transferred to user\"}},\"getAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\",\"details\":\"This function retrieves values without altering token prices\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"getUpdatedAmountIn(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountOutMantissa\":\"Amount of tokenAddressOut user wants to receive\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressOut should be transferred after conversion\",\"amountInMantissa\":\"Amount of the tokenAddressIn sender would send to contract before conversion\"}},\"getUpdatedAmountOut(uint256,address,address)\":{\"custom:error\":\"InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\",\"params\":{\"amountInMantissa\":\"Amount of tokenAddressIn\",\"tokenAddressIn\":\"Address of the token to convert\",\"tokenAddressOut\":\"Address of the token to get after conversion\"},\"returns\":{\"amountConvertedMantissa\":\"Amount of tokenAddressIn should be transferred after conversion\",\"amountOutMantissa\":\"Amount of the tokenAddressOut sender should receive after conversion\"}},\"initialize(address,address,address,address,uint256)\":{\"params\":{\"accessControlManager_\":\"Access control manager contract address\",\"baseAsset_\":\"Address of the base asset\",\"destinationAddress_\":\"Address at all incoming tokens will transferred to\",\"minAmountToConvert_\":\"Minimum amount to convert\",\"priceOracle_\":\"Resilient oracle address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pauseConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensPaused thrown when conversion is already paused\",\"custom:event\":\"Emits ConversionPaused on success\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"resumeConversion()\":{\"custom:access\":\"Restricted by ACM\",\"custom:error\":\"ConversionTokensActive thrown when conversion is already active\",\"custom:event\":\"Emits ConversionResumed on success\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setBaseAsset(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"baseAsset_\":\"The new address of the base asset\"}},\"setConversionConfig(address,address,(uint256,uint8))\":{\"custom:access\":\"Controlled by AccessControlManager\",\"custom:error\":\"Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\",\"custom:event\":\"Emits ConversionConfigUpdated event on success\",\"params\":{\"conversionConfig\":\"ConversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressOut\":\"Address of tokenOut\"}},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"custom:error\":\"InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\",\"params\":{\"conversionConfigs\":\"Array of conversionConfig config details to update\",\"tokenAddressIn\":\"Address of tokenIn\",\"tokenAddressesOut\":\"Array of addresses of tokenOut\"}},\"setConverterNetwork(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"converterNetwork_\":\"The converterNetwork address to be set\"}},\"setDestination(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"destinationAddress_\":\"The new destination address to be set\"}},\"setMinAmountToConvert(uint256)\":{\"custom:access\":\"Only Governance\",\"params\":{\"minAmountToConvert_\":\"Min amount to convert\"}},\"setPriceOracle(address)\":{\"custom:access\":\"Only Governance\",\"params\":{\"priceOracle_\":\"Address of the new price oracle to set\"}},\"sweepToken(address,address,uint256)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\",\"custom:event\":\"Emits SweepToken event on success\",\"params\":{\"amount\":\"The amount to transfer\",\"to\":\"The address to which tokens will be transferred\",\"tokenAddress\":\"The address of the ERC-20 token to sweep\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address)\":{\"details\":\"This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\",\"params\":{\"asset\":\"Asset address\",\"comptroller\":\"Comptroller address (pool)\"}}},\"title\":\"SingleTokenConverter\",\"version\":1},\"userdoc\":{\"errors\":{\"AmountInHigherThanMax(uint256,uint256)\":[{\"notice\":\"Thrown when amountIn is higher than amountInMax\"}],\"AmountInMismatched()\":[{\"notice\":\"Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\"}],\"AmountOutLowerThanMinRequired(uint256,uint256)\":[{\"notice\":\"Thrown when amountOut is lower than amountOutMin\"}],\"AmountOutMismatched()\":[{\"notice\":\"Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\"}],\"ConversionConfigNotEnabled()\":[{\"notice\":\"Thrown when conversion is disabled or config does not exist for given pair\"}],\"ConversionEnabledOnlyForPrivateConversions()\":[{\"notice\":\"Thrown when conversion is enabled only for private conversions\"}],\"ConversionTokensActive()\":[{\"notice\":\"Thrown when conversion is Active\"}],\"ConversionTokensPaused()\":[{\"notice\":\"Thrown when conversion is paused\"}],\"DeflationaryTokenNotSupported()\":[{\"notice\":\"Thrown when using convertForExactTokens deflationary tokens\"}],\"IncentiveTooHigh(uint256,uint256)\":[{\"notice\":\"Thrown when incentive is higher than the MAX_INCENTIVE\"}],\"InputLengthMisMatch()\":[{\"notice\":\"Thrown when there is a mismatch in the length of input arrays\"}],\"InsufficientInputAmount()\":[{\"notice\":\"Thrown when given input amount is zero\"}],\"InsufficientOutputAmount()\":[{\"notice\":\"Thrown when given output amount is zero\"}],\"InsufficientPoolLiquidity()\":[{\"notice\":\"Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\"}],\"InvalidConverterNetwork()\":[{\"notice\":\"When address of the ConverterNetwork is not set or Zero address\"}],\"InvalidMinimumAmountToConvert()\":[{\"notice\":\"Thrown when minimum amount to convert is zero\"}],\"InvalidToAddress()\":[{\"notice\":\"Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\"}],\"InvalidTokenConfigAddresses()\":[{\"notice\":\"Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\"}],\"NonZeroIncentiveForPrivateConversion()\":[{\"notice\":\"Thrown when trying to set non zero incentive for private conversion\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}],\"ZeroValueNotAllowed()\":[{\"notice\":\"Thrown if the supplied value is 0 where it is not allowed\"}]},\"events\":{\"AssetTransferredToDestination(address,address,address,uint256)\":{\"notice\":\"Emmitted after the funds transferred to the destination address\"},\"BaseAssetUpdated(address,address)\":{\"notice\":\"Emitted when base asset is updated\"},\"ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)\":{\"notice\":\"Emitted when config is updated for tokens pair\"},\"ConversionPaused(address)\":{\"notice\":\"Emitted when conversion is paused\"},\"ConversionResumed(address)\":{\"notice\":\"Emitted when conversion is unpaused\"},\"ConvertedExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens\"},\"ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\"},\"ConvertedForExactTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens\"},\"ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)\":{\"notice\":\"Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\"},\"ConverterNetworkAddressUpdated(address,address)\":{\"notice\":\"Emitted when converterNetwork address is updated\"},\"DestinationAddressUpdated(address,address)\":{\"notice\":\"Emitted when destination address is updated\"},\"MinAmountToConvertUpdated(uint256,uint256)\":{\"notice\":\"Emitted when minimum amount to convert is updated\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PriceOracleUpdated(address,address)\":{\"notice\":\"Emitted when price oracle address is updated\"},\"SweepToken(address,address,uint256)\":{\"notice\":\"Event emitted when tokens are swept\"}},\"kind\":\"user\",\"methods\":{\"MAX_INCENTIVE()\":{\"notice\":\"Maximum incentive could be\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"balanceOf(address)\":{\"notice\":\"Get the balance for specific token\"},\"baseAsset()\":{\"notice\":\"Address of the base asset token\"},\"conversionConfigurations(address,address)\":{\"notice\":\"conversion configurations for the existing pairs\"},\"conversionPaused()\":{\"notice\":\"Boolean for if conversion is paused\"},\"convertExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\"},\"convertForExactTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted\"},\"convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)\":{\"notice\":\"Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\"},\"converterNetwork()\":{\"notice\":\"Address of the converterNetwork contract\"},\"destinationAddress()\":{\"notice\":\"Address that all incoming tokens are transferred to\"},\"getAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)\"},\"getAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\"},\"getUpdatedAmountIn(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\"},\"getUpdatedAmountOut(uint256,address,address)\":{\"notice\":\"To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\"},\"minAmountToConvert()\":{\"notice\":\"Min amount to convert for private conversions. Defined in USD, with 18 decimals\"},\"pauseConversion()\":{\"notice\":\"Pause conversion of tokens\"},\"priceOracle()\":{\"notice\":\"Venus price oracle contract\"},\"resumeConversion()\":{\"notice\":\"Resume conversion of tokens.\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setBaseAsset(address)\":{\"notice\":\"Sets the base asset for the contract\"},\"setConversionConfig(address,address,(uint256,uint8))\":{\"notice\":\"Set the configuration for new or existing conversion pair\"},\"setConversionConfigs(address,address[],(uint256,uint8)[])\":{\"notice\":\"Batch sets the conversion configurations\"},\"setConverterNetwork(address)\":{\"notice\":\"Sets a converter network contract address\"},\"setDestination(address)\":{\"notice\":\"Sets a new destination address\"},\"setMinAmountToConvert(uint256)\":{\"notice\":\"Min amount to convert setter\"},\"setPriceOracle(address)\":{\"notice\":\"Sets a new price oracle\"},\"sweepToken(address,address,uint256)\":{\"notice\":\"To sweep ERC20 tokens and transfer them to user(to address)\"},\"updateAssetsState(address,address)\":{\"notice\":\"This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters\"}},\"notice\":\"SingleTokenConverter used for token conversions and sends received tokens\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/SingleTokenConverter.sol\":\"SingleTokenConverter\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\\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\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\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 cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x005e52885b8f7935dbccb1c87847229a9a2bfb66fd75fe200c9ec6f8a5d7a0e9\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2432799b0d824fc701beb4c30146e912b9aeecf77b5c1635dde6c5fbe6bfc3a7\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x6e71c3df86501df5c0e4bace1333c0c91f9f9cced252a54fb99eeda219b789d5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x14de93ead464da249af31bea0e3bcfb62ec693bea3475fb4d90f055ac81dc5eb\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd9a747f176d9b9de220331b87ed711cc2bd594a118b538a35f3c47060bff7a8b\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/AbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\nimport { MANTISSA_ONE, EXP_SCALE } from \\\"@venusprotocol/solidity-utilities/contracts/constants.sol\\\";\\n\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title AbstractTokenConverter\\n/// @author Venus\\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\\n/*\\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\\n *\\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\\n * a. convertExactTokensSupportingFeeOnTransferTokens\\n * b. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\\n * similar to Case I.\\n *\\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * a. convertExactTokens\\n * b. convertForExactTokens\\n * c. convertExactTokensSupportingFeeOnTransferTokens\\n * d. convertForExactTokensSupportingFeeOnTransferTokens\\n *\\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\\n * similar to Case III.\\n *\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n * Example 1:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInAmount - 100\\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\\n * function for tokenIn as deflationary token.\\n *\\n * Example 2:-\\n * tokenInAddress - 0xaaaa.....\\n * tokenOutAddress - 0xbbbb.....\\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\\n * tokenOutAmount - 70\\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\\n * ------------------------------------------------------------------------------------------------------------------------------------\\n *\\n * This contract also supports private conversion between the converters:\\n * Private conversions:\\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\\n *\\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\\n *\\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\\n * tokenAddressOut: As base asset of that converter.\\n *\\n * ConverterNetwork:\\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\\n * and tokenAddressOut provided.\\n *\\n * findTokenConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\\n *\\n * findTokenConvertersForConverters():\\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\\n */\\n\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Maximum incentive could be\\n uint256 public constant MAX_INCENTIVE = 0.5e18;\\n\\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\\n uint256 public minAmountToConvert;\\n\\n /// @notice Venus price oracle contract\\n ResilientOracle public priceOracle;\\n\\n /// @notice conversion configurations for the existing pairs\\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\\n\\n /// @notice Address that all incoming tokens are transferred to\\n address public destinationAddress;\\n\\n /// @notice Boolean for if conversion is paused\\n bool public conversionPaused;\\n\\n /// @notice Address of the converterNetwork contract\\n IConverterNetwork public converterNetwork;\\n\\n /// @dev This empty reserved space is put in place to allow future versions to add new\\n /// variables without shifting down storage in the inheritance chain.\\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n uint256[45] private __gap;\\n\\n /// @notice Emitted when config is updated for tokens pair\\n event ConversionConfigUpdated(\\n address indexed tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 oldIncentive,\\n uint256 newIncentive,\\n ConversionAccessibility oldAccess,\\n ConversionAccessibility newAccess\\n );\\n /// @notice Emitted when price oracle address is updated\\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\\n\\n /// @notice Emitted when destination address is updated\\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\\n\\n /// @notice Emitted when converterNetwork address is updated\\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens\\n event ConvertedExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens\\n event ConvertedForExactTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n address indexed sender,\\n address indexed receiver,\\n address tokenAddressIn,\\n address indexed tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n );\\n\\n /// @notice Emitted when conversion is paused\\n event ConversionPaused(address indexed sender);\\n\\n /// @notice Emitted when conversion is unpaused\\n event ConversionResumed(address indexed sender);\\n\\n /// @notice Event emitted when tokens are swept\\n event SweepToken(address indexed token, address indexed to, uint256 amount);\\n\\n /// @notice Emitted when minimum amount to convert is updated\\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\\n\\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\\n error AmountOutMismatched();\\n\\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\\n error AmountInMismatched();\\n\\n /// @notice Thrown when given input amount is zero\\n error InsufficientInputAmount();\\n\\n /// @notice Thrown when given output amount is zero\\n error InsufficientOutputAmount();\\n\\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\\n error ConversionConfigNotEnabled();\\n\\n /// @notice Thrown when conversion is enabled only for private conversions\\n error ConversionEnabledOnlyForPrivateConversions();\\n\\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n error InvalidToAddress();\\n\\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\\n\\n /// @notice Thrown when amountOut is lower than amountOutMin\\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\\n\\n /// @notice Thrown when amountIn is higher than amountInMax\\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\\n\\n /// @notice Thrown when conversion is paused\\n error ConversionTokensPaused();\\n\\n /// @notice Thrown when conversion is Active\\n error ConversionTokensActive();\\n\\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\\n error InvalidTokenConfigAddresses();\\n\\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\\n error InsufficientPoolLiquidity();\\n\\n /// @notice When address of the ConverterNetwork is not set or Zero address\\n error InvalidConverterNetwork();\\n\\n /// @notice Thrown when trying to set non zero incentive for private conversion\\n error NonZeroIncentiveForPrivateConversion();\\n\\n /// @notice Thrown when using convertForExactTokens deflationary tokens\\n error DeflationaryTokenNotSupported();\\n\\n /// @notice Thrown when minimum amount to convert is zero\\n error InvalidMinimumAmountToConvert();\\n\\n /// @notice Thrown when there is a mismatch in the length of input arrays\\n error InputLengthMisMatch();\\n\\n /**\\n * @notice Modifier to ensure valid conversion parameters for a token conversion\\n * and check if conversion is paused or not\\n * @param to The recipient address for the converted tokens\\n * @param tokenAddressIn The input token address for the conversion\\n * @param tokenAddressOut The output token address for the conversion\\n */\\n modifier validConversionParameters(\\n address to,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) {\\n _checkConversionPaused();\\n ensureNonzeroAddress(to);\\n if (to == tokenAddressIn || to == tokenAddressOut) {\\n revert InvalidToAddress();\\n }\\n _;\\n }\\n\\n /// @notice Pause conversion of tokens\\n /// @custom:event Emits ConversionPaused on success\\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\\n /// @custom:access Restricted by ACM\\n function pauseConversion() external {\\n _checkAccessAllowed(\\\"pauseConversion()\\\");\\n _checkConversionPaused();\\n conversionPaused = true;\\n emit ConversionPaused(msg.sender);\\n }\\n\\n /// @notice Resume conversion of tokens.\\n /// @custom:event Emits ConversionResumed on success\\n /// @custom:error ConversionTokensActive thrown when conversion is already active\\n /// @custom:access Restricted by ACM\\n function resumeConversion() external {\\n _checkAccessAllowed(\\\"resumeConversion()\\\");\\n if (!conversionPaused) {\\n revert ConversionTokensActive();\\n }\\n\\n conversionPaused = false;\\n emit ConversionResumed(msg.sender);\\n }\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:access Only Governance\\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\\n _setPriceOracle(priceOracle_);\\n }\\n\\n /// @notice Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:access Only Governance\\n function setDestination(address destinationAddress_) external onlyOwner {\\n _setDestination(destinationAddress_);\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:access Only Governance\\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\\n _setConverterNetwork(converterNetwork_);\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:access Only Governance\\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\\n _checkAccessAllowed(\\\"setMinAmountToConvert(uint256)\\\");\\n _setMinAmountToConvert(minAmountToConvert_);\\n }\\n\\n /// @notice Batch sets the conversion configurations\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressesOut Array of addresses of tokenOut\\n /// @param conversionConfigs Array of conversionConfig config details to update\\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\\n function setConversionConfigs(\\n address tokenAddressIn,\\n address[] calldata tokenAddressesOut,\\n ConversionConfig[] calldata conversionConfigs\\n ) external {\\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\\n\\n for (uint256 i; i < tokenOutArrayLength; ) {\\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert AmountInMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\\n /// otherwise the amount is adjusted\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n if (actualAmountOut != amountOutMantissa) {\\n revert AmountOutMismatched();\\n }\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n }\\n\\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\\n amountInMantissa,\\n amountOutMinMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount transferred to destination\\n /// @return actualAmountOut Actual amount transferred to user\\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n )\\n external\\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\\n nonReentrant\\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\\n {\\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\\n amountInMaxMantissa,\\n amountOutMantissa,\\n tokenAddressIn,\\n tokenAddressOut,\\n to\\n );\\n\\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\\n msg.sender,\\n to,\\n tokenAddressIn,\\n tokenAddressOut,\\n actualAmountIn,\\n actualAmountOut\\n );\\n }\\n\\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\\n /// @param tokenAddress The address of the ERC-20 token to sweep\\n /// @param to The address to which tokens will be transferred\\n /// @param amount The amount to transfer\\n /// @custom:event Emits SweepToken event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\\n /// @custom:access Only Governance\\n function sweepToken(\\n address tokenAddress,\\n address to,\\n uint256 amount\\n ) external onlyOwner nonReentrant {\\n ensureNonzeroAddress(tokenAddress);\\n ensureNonzeroAddress(to);\\n ensureNonzeroValue(amount);\\n\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n preSweepToken(tokenAddress, amount);\\n token.safeTransfer(to, amount);\\n\\n emit SweepToken(tokenAddress, to, amount);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n amountConvertedMantissa = amountInMantissa;\\n uint256 tokenInToOutConversion;\\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountConvertedMantissa = _divRoundingUp(maxTokenOutReserve * EXP_SCALE, tokenInToOutConversion);\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\\n /// @dev This function retrieves values without altering token prices\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n if (\\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountOutMantissa) {\\n amountOutMantissa = maxTokenOutReserve;\\n }\\n\\n amountConvertedMantissa = amountOutMantissa;\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountInMantissa;\\n }\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\\n priceOracle.updateAssetPrice(tokenAddressIn);\\n priceOracle.updateAssetPrice(tokenAddressOut);\\n\\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n amountConvertedMantissa = amountOutMantissa;\\n }\\n\\n /// @notice This method updated the states of this contract after getting funds from PSR\\n /// after settling the amount(if any) through privateConversion between converters\\n /// @dev This function is called by protocolShareReserve\\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\\n if (balanceDiff > 0) {\\n _privateConversion(comptroller, asset, balanceDiff);\\n }\\n }\\n\\n /// @notice Set the configuration for new or existing conversion pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n /// @custom:event Emits ConversionConfigUpdated event on success\\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\\n /// @custom:access Controlled by AccessControlManager\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) public {\\n _checkAccessAllowed(\\\"setConversionConfig(address,address,ConversionConfig)\\\");\\n ensureNonzeroAddress(tokenAddressIn);\\n ensureNonzeroAddress(tokenAddressOut);\\n\\n if (conversionConfig.incentive > MAX_INCENTIVE) {\\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\\n }\\n\\n if (\\n (tokenAddressIn == tokenAddressOut) ||\\n (tokenAddressIn != _getDestinationBaseAsset()) ||\\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\\n ) {\\n revert InvalidTokenConfigAddresses();\\n }\\n\\n if (\\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\\n conversionConfig.incentive != 0\\n ) {\\n revert NonZeroIncentiveForPrivateConversion();\\n }\\n\\n if (\\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\\n (address(converterNetwork) == address(0))\\n ) {\\n revert InvalidConverterNetwork();\\n }\\n\\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n emit ConversionConfigUpdated(\\n tokenAddressIn,\\n tokenAddressOut,\\n configuration.incentive,\\n conversionConfig.incentive,\\n configuration.conversionAccess,\\n conversionConfig.conversionAccess\\n );\\n\\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n } else {\\n configuration.incentive = conversionConfig.incentive;\\n configuration.conversionAccess = conversionConfig.conversionAccess;\\n }\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\\n\\n /// @dev Operations to perform before sweeping tokens\\n /// @param token Address of the token\\n /// @param amount Amount transferred to address(to)\\n function preSweepToken(address token, uint256 amount) internal virtual {}\\n\\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\\n function _convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n if (amountOutMantissa < amountOutMinMantissa) {\\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\\n /// it is called by convertForExactTokens function\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n if (actualAmountIn != amountInMantissa) {\\n revert DeflationaryTokenNotSupported();\\n }\\n\\n if (actualAmountIn > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\\n actualAmountOut = amountOutMantissa;\\n }\\n\\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\\n function _convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\\n\\n if (amountInMantissa > amountInMaxMantissa) {\\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\\n }\\n\\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\\n\\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\\n\\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\\n }\\n\\n /// @dev return actualAmountOut from reserves for tokenAddressOut\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param to Address of the tokenAddressOut receiver\\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n function _doTransferOut(\\n address tokenAddressOut,\\n address to,\\n uint256 amountConvertedMantissa\\n ) internal {\\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\\n\\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\\n if (maxTokenOutReserve < amountConvertedMantissa) {\\n revert InsufficientPoolLiquidity();\\n }\\n\\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\\n\\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\\n tokenOut.safeTransfer(to, amountConvertedMantissa);\\n }\\n\\n /// @notice Transfer tokenAddressIn from user to destination\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @return actualAmountIn Actual amount transferred to destination\\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\\n }\\n\\n /// @dev Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n /// @custom:event Emits PriceOracleUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\\n ensureNonzeroAddress(address(priceOracle_));\\n emit PriceOracleUpdated(priceOracle, priceOracle_);\\n priceOracle = priceOracle_;\\n }\\n\\n /// @dev Sets a new destination address\\n /// @param destinationAddress_ The new destination address to be set\\n /// @custom:event Emits DestinationAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\\n function _setDestination(address destinationAddress_) internal {\\n ensureNonzeroAddress(destinationAddress_);\\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\\n destinationAddress = destinationAddress_;\\n }\\n\\n /// @notice Sets a converter network contract address\\n /// @param converterNetwork_ The converterNetwork address to be set\\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\\n ensureNonzeroAddress(address(converterNetwork_));\\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\\n converterNetwork = converterNetwork_;\\n }\\n\\n /// @notice Min amount to convert setter\\n /// @param minAmountToConvert_ Min amount to convert\\n /// @custom:event MinAmountToConvertUpdated is emitted in success\\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\\n ensureNonzeroValue(minAmountToConvert_);\\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\\n minAmountToConvert = minAmountToConvert_;\\n }\\n\\n /// @dev Hook to perform after converting tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @param amountIn Amount of tokenIn converted\\n /// @param amountOut Amount of tokenOut converted\\n function _postConversionHook(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n uint256 amountIn,\\n uint256 amountOut\\n ) internal virtual {}\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n __AccessControlled_init(accessControlManager_);\\n __ReentrancyGuard_init();\\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param minAmountToConvert_ minimum amount to convert\\n function __AbstractTokenConverter_init_unchained(\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n uint256 minAmountToConvert_\\n ) internal onlyInitializing {\\n _setPriceOracle(priceOracle_);\\n _setDestination(destinationAddress_);\\n _setMinAmountToConvert(minAmountToConvert_);\\n conversionPaused = false;\\n }\\n\\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address\\n /// @return Amount of asset, for _privateConversion\\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\\n\\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\\n /// destination contract as destination's base asset\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\\n function _privateConversion(\\n address comptroller,\\n address tokenAddressOut,\\n uint256 amountToConvert\\n ) internal {\\n address tokenAddressIn = _getDestinationBaseAsset();\\n address _destinationAddress = destinationAddress;\\n uint256 convertedTokenInBalance;\\n if (address(converterNetwork) != address(0)) {\\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\\n uint256 convertersLength = converterAddresses.length;\\n for (uint256 i; i < convertersLength; ) {\\n if (converterBalances[i] == 0) break;\\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\\n converterBalances[i],\\n tokenAddressOut,\\n tokenAddressIn\\n );\\n if (amountIn > amountToConvert) {\\n amountIn = amountToConvert;\\n }\\n\\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\\n break;\\n }\\n\\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n\\n IERC20Upgradeable(tokenAddressOut).forceApprove(converterAddresses[i], amountIn);\\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\\n amountIn,\\n 0,\\n tokenAddressOut,\\n tokenAddressIn,\\n _destinationAddress\\n );\\n\\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\\n amountToConvert -= amountIn;\\n convertedTokenInBalance += (balanceAfter - balanceBefore);\\n\\n if (amountToConvert == 0) break;\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n _postPrivateConversionHook(\\n comptroller,\\n tokenAddressIn,\\n convertedTokenInBalance,\\n tokenAddressOut,\\n amountToConvert\\n );\\n }\\n\\n /// @dev This hook is used to update states for the converter after the privateConversion\\n /// @param comptroller Comptroller address (pool)\\n /// @param tokenAddressIn Address of the destination's base asset\\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\\n function _postPrivateConversionHook(\\n address comptroller,\\n address tokenAddressIn,\\n uint256 convertedTokenInBalance,\\n address tokenAddressOut,\\n uint256 convertedTokenOutBalance\\n ) internal virtual {}\\n\\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\\n /// @param tokenOutAddress Address of the asset to be transferred to the user\\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\\n\\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\\n /// @param amountIn The amount to convert\\n /// @param tokenAddress Address of the token\\n /// @return isValid true if amount to convert is greater than minimum amount to convert\\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\\n priceOracle.updateAssetPrice(tokenAddress);\\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\\n\\n if (amountInInUsd >= minAmountToConvert) {\\n isValid = true;\\n }\\n }\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\\n if (amountInMantissa == 0) {\\n revert InsufficientInputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\\n /// multiplied by conversionWithIncentive which will be >= 1\\n amountOutMantissa = (amountInMantissa * tokenInToOutConversion) / (EXP_SCALE);\\n }\\n\\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function _getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\\n if (amountOutMantissa == 0) {\\n revert InsufficientOutputAmount();\\n }\\n\\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\\n\\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\\n revert ConversionConfigNotEnabled();\\n }\\n\\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\\n\\n uint256 incentive = configuration.incentive;\\n\\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\\n converterNetwork.isTokenConverter(msg.sender);\\n if (isPrivateConversion) {\\n incentive = 0;\\n }\\n\\n /// conversion rate after considering incentive(conversionWithIncentive)\\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\\n\\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\\n if (isPrivateConversion) {\\n amountInMantissa =\\n (amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE) /\\n (tokenInUnderlyingPrice * conversionWithIncentive);\\n } else {\\n amountInMantissa = _divRoundingUp(\\n amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE,\\n tokenInUnderlyingPrice * conversionWithIncentive\\n );\\n }\\n\\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\\n }\\n\\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\\n if (\\n (!(isConverter) &&\\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\\n ) {\\n revert ConversionEnabledOnlyForPrivateConversions();\\n }\\n }\\n\\n /// @dev To check, is conversion paused\\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\\n function _checkConversionPaused() internal view {\\n if (conversionPaused) {\\n revert ConversionTokensPaused();\\n }\\n }\\n\\n /// @dev Get base asset address of the destination contract\\n /// @return Address of the base asset\\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\\n\\n /// @dev Performs division where the result is rounded up\\n /// @param numerator The numerator of the division operation\\n /// @param denominator The denominator of the division operation. Must be non-zero\\n /// @return The result of the division, rounded up\\n function _divRoundingUp(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\\n return (numerator + denominator - 1) / denominator;\\n }\\n}\\n\",\"keccak256\":\"0xf87680dcb5a46a16663923c575661eda78ef57d29b7d78a85ddac00062426e18\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0x7852d4f8a6dd1c80d14342f8ff2e26f723eb00c888e9a9e50a5fe8f95c59200c\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/SingleTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SafeERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { AbstractTokenConverter } from \\\"./AbstractTokenConverter.sol\\\";\\n\\n/// @title SingleTokenConverter\\n/// @author Venus\\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract SingleTokenConverter is AbstractTokenConverter {\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice Address of the base asset token\\n address public baseAsset;\\n\\n /// @notice Emitted when base asset is updated\\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\\n\\n /// @notice Emmitted after the funds transferred to the destination address\\n event AssetTransferredToDestination(\\n address indexed receiver,\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount\\n );\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @param accessControlManager_ Access control manager contract address\\n /// @param priceOracle_ Resilient oracle address\\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\\n /// @param baseAsset_ Address of the base asset\\n /// @param minAmountToConvert_ Minimum amount to convert\\n function initialize(\\n address accessControlManager_,\\n ResilientOracle priceOracle_,\\n address destinationAddress_,\\n address baseAsset_,\\n uint256 minAmountToConvert_\\n ) public initializer {\\n _setBaseAsset(baseAsset_);\\n\\n // Initialize AbstractTokenConverter\\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\\n }\\n\\n /// @notice Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:access Only Governance\\n function setBaseAsset(address baseAsset_) external onlyOwner {\\n _setBaseAsset(baseAsset_);\\n }\\n\\n /// @notice Get the balance for specific token\\n /// @param tokenAddress Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\\n tokenBalance = token.balanceOf(address(this));\\n }\\n\\n /// @param comptroller Comptroller address (pool)\\n /// @param asset Asset address.\\n /// @return balanceLeft Amount of asset, for _privateConversion\\n // solhint-disable-next-line\\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\\n IERC20Upgradeable token = IERC20Upgradeable(asset);\\n uint256 balance = token.balanceOf(address(this));\\n balanceLeft = balance;\\n\\n if (asset == baseAsset) {\\n balanceLeft = 0;\\n token.safeTransfer(destinationAddress, balance);\\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\\n }\\n }\\n\\n /// @dev Sets the base asset for the contract\\n /// @param baseAsset_ The new address of the base asset\\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\\n /// @custom:event BaseAssetUpdated is emitted on success\\n function _setBaseAsset(address baseAsset_) internal {\\n ensureNonzeroAddress(baseAsset_);\\n emit BaseAssetUpdated(baseAsset, baseAsset_);\\n baseAsset = baseAsset_;\\n }\\n\\n /// @dev Get base asset address\\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\\n destinationBaseAsset = baseAsset;\\n }\\n}\\n\",\"keccak256\":\"0xabeb5e99b4aa03662ffa8fac4e9314a018eb8a674ac73085066d8f38e16be45f\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x6080604052348015600f57600080fd5b506016601a565b60d7565b600054610100900460ff161560855760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161460d5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6141a6806100e66000396000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613958565b610562565b005b6102ee6102e9366004613975565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613958565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613958565b610635565b6102ee61034a3660046139b7565b610646565b6102d961035d366004613958565b610784565b6102d9610370366004613958565b610795565b6102d96107a6565b6102ee61038b366004613975565b61088c565b6102d961039e366004613a16565b61095a565b6102ee6103b1366004613975565b6109f7565b6102ee6103c4366004613975565b610b00565b6103dc6103d7366004613958565b610bff565b604051908152602001610288565b6102d9610c8c565b6102d9610400366004613a57565b610ca0565b6102d9610ce7565b6033546001600160a01b0316610274565b6102ee61042c3660046139b7565b610d77565b6102d961043f366004613a70565b610e61565b610479610452366004613a70565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b604051610288929190613b13565b6097546001600160a01b0316610274565b6102ee6104a63660046139b7565b610e97565b6102d9610f81565b6102d96104c1366004613b73565b611033565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b3660046139b7565b6110d1565b6102d961052e366004613c27565b6111f4565b6102d9610541366004613958565b611593565b6102d9610554366004613c98565b61161c565b6103dc60fb5481565b61056a6117a6565b61057381611800565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613aa9565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610bff565b905085811015610608578095505b85925061061686868661187d565b508092505050935093915050565b61062c6117a6565b61057381611be3565b61063d6117a6565b61057381611cd8565b600080828585610654611d57565b61065d83611dac565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611dec565b6106da8a8a8a8a8a611e45565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117a6565b61057381611ecc565b61079d6117a6565b61057381611f49565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611fc6565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613aa9565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610915868686612092565b9092509050600061092585610bff565b9050828110156109505761094a610944670de0b6b3a764000083613d2b565b8361239f565b93508092505b5050935093915050565b6109626117a6565b61096a611dec565b61097383611dac565b61097c82611dac565b610985816123cb565b8261099a6001600160a01b0382168484612405565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109df91815260200190565b60405180910390a3506109f2600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610ad357600080fd5b505af1158015610ae7573d6000803e3d6000fd5b50505050610af6858585612092565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b6457600080fd5b505af1158015610b78573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bdc57600080fd5b505af1158015610bf0573d6000803e3d6000fd5b50505050610af685858561187d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c859190613d42565b9392505050565b610c946117a6565b610c9e60006124cc565b565b610cde6040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611fc6565b610573816124fd565b60655433906001600160a01b03168114610d6e5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610573816124cc565b600080828585610d85611d57565b610d8e83611dac565b816001600160a01b0316836001600160a01b03161480610dbf5750806001600160a01b0316836001600160a01b0316145b15610df6576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dfe611dec565b610e0b8a8a8a8a8a611e45565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e69611dec565b6000610e758383612547565b90508015610e8857610e8883838361265c565b50610e93600160c955565b5050565b600080828585610ea5611d57565b610eae83611dac565b816001600160a01b0316836001600160a01b03161480610edf5750806001600160a01b0316836001600160a01b0316145b15610f16576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f1e611dec565b610f2b8a8a8a8a8a612ab1565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fbf6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611fc6565b610fc7611d57565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b8281811461106d576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110c8576110c08787878481811061108e5761108e613d5b565b90506020020160208101906110a39190613958565b8686858181106110b5576110b5613d5b565b9050604002016111f4565b600101611070565b50505050505050565b6000808285856110df611d57565b6110e883611dac565b816001600160a01b0316836001600160a01b031614806111195750806001600160a01b0316836001600160a01b0316145b15611150576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611158611dec565b6111658a8a8a8a8a612b43565b90955093508884146111a3576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61121560405180606001604052806035815260200161413c60359139611fc6565b61121e83611dac565b61122782611dac565b6706f05b59d3b200008135111561127b576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d65565b816001600160a01b0316836001600160a01b031614806112aa575061012d546001600160a01b03848116911614155b806112f2575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff1660038111156112ef576112ef613aa9565b14155b15611329576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261133b6040830160208401613d8a565b600381111561134c5761134c613aa9565b1480156113595750803515155b15611390576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113a26040830160208401613d8a565b60038111156113b3576113b3613aa9565b14806113df575060016113cc6040830160208401613d8a565b60038111156113dd576113dd613aa9565b145b80156113f4575060ff546001600160a01b0316155b1561142b576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff9091169161149b91908a01908a01613d8a565b6040516114ab9493929190613dab565b60405180910390a360006114c56040840160208501613d8a565b60038111156114d6576114d6613aa9565b03611533576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905561158d565b813581556115476040830160208401613d8a565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600381111561158757611587613aa9565b02179055505b50505050565b61159b6117a6565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115e46033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff161580801561163c5750600054600160ff909116105b806116565750303b158015611656575060005460ff166001145b6116c85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d65565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561172657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61172f83611cd8565b61173b86868685612c00565b801561179e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610c9e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d65565b61180981611dac565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118ba576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561190e5761190e613aa9565b600381111561191f5761191f613aa9565b905250905060008160200151600381111561193c5761193c613aa9565b03611973576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb9190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a889190613d42565b835160ff54919250906000906001600160a01b031615801590611b2b575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2b9190613dd3565b90508015611b3857600091505b6000611b4c83670de0b6b3a7640000613df5565b90508115611b8c57611b5e8186613d2b565b670de0b6b3a7640000611b71868e613d2b565b611b7b9190613d2b565b611b859190613e08565b9750611bbe565b611bbb670de0b6b3a7640000611ba2868e613d2b565b611bac9190613d2b565b611bb68388613d2b565b61239f565b97505b83611bc98287613d2b565b611bd39190613e08565b9650505050505050935093915050565b6001600160a01b038116611c5f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d65565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611ce181611dac565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610c9e576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e3e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d65565b600260c955565b600080611e528585612c99565b611e5c8588612db9565b9150611e698286866109f7565b91505085811015611eb0576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d65565b611ebb848483612f04565b9550959350505050565b600160c955565b611ed581611dac565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f5281611dac565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906120129033908690600401613eb1565b602060405180830381865afa15801561202f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120539190613dd3565b905080610e93573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d6593929190613ed3565b600080846000036120cf576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561212357612123613aa9565b600381111561213457612134613aa9565b905250905060008160200151600381111561215157612151613aa9565b03612188576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122109190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229d9190613d42565b835160ff54919250906001600160a01b03161580159061233d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233d9190613dd3565b15612346575060005b600061235a82670de0b6b3a7640000613df5565b9050826123678286613d2b565b6123719190613e08565b9550670de0b6b3a7640000612386878c613d2b565b6123909190613e08565b96505050505050935093915050565b60008160016123ae8286613df5565b6123b89190613eff565b6123c29190613e08565b90505b92915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b0383166024820152604481018290526109f29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612f67565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105738161304f565b612506816123cb565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190613d42565b61012d549093508391506001600160a01b03908116908516036126545760fe546000935061260a906001600160a01b03848116911683612405565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061267161012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612aac5760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af1158015612700573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127469190810190614023565b8151919350915060005b81811015612aa75782818151811061276a5761276a613d5b565b602002602001015160000315612aa757600084828151811061278e5761278e613d5b565b60200260200101516001600160a01b0316636f1a30a88584815181106127b6576127b6613d5b565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127f8939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015612816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283a91906140e8565b915050888111156128485750875b612852818b6130b9565b61285c5750612aa7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa1580156128bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e39190613d42565b905061291c8684815181106128fa576128fa613d5b565b6020026020010151838d6001600160a01b03166131f19092919063ffffffff16565b85838151811061292e5761292e613d5b565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af11580156129b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc91906140e8565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a659190613d42565b9050612a71838c613eff565b9a50612a7d8282613eff565b612a879089613df5565b97508a600003612a9957505050612aa7565b836001019350505050612750565b505050505b61179e565b600080612abe8585612c99565b6000612acb878787610b00565b91505087811115612b12576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612b1c8682612db9565b9250612b298387876109f7565b9250612b389050858584612f04565b509550959350505050565b600080612b508585612c99565b6000612b5d878787610b00565b915050612b6a8682612db9565b9250808314612ba5576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612be9576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612bf4858589612f04565b50909694955050505050565b600054610100900460ff16612c7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b612c86846132c7565b612c8e613355565b61158d8383836133da565b60ff546000906001600160a01b031615801590612d36575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d369190613dd3565b905080158015612d82575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612d8057612d80613aa9565b145b156109f2576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e469190613d42565b60fe54909150612e65906001600160a01b03848116913391168761349f565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612eca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eee9190613d42565b9050612efa8282613eff565b9695505050505050565b6000612f0f84610bff565b905081811015612f4b576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612f606001600160a01b0382168585612405565b5050505050565b6000612fbc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134f09092919063ffffffff16565b9050805160001480612fdd575080806020019051810190612fdd9190613dd3565b6109f25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d65565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561311a57600080fd5b505af115801561312e573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c69190613d42565b6131d09190613d2b565b6131da9190613e08565b905060fb5481106131ea57600191505b5092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526132708482613507565b61158d576040516001600160a01b0384166024820152600060448201526132bd9085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161244a565b61158d8482612f67565b600054610100900460ff166133445760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61334c6135ae565b61057381613633565b600054610100900460ff166133d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e6136b0565b600054610100900460ff166134575760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61346083611f49565b61346982611800565b613472816124fd565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b038085166024830152831660448201526064810182905261158d9085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161244a565b60606134ff848460008561372d565b949350505050565b6000806000846001600160a01b031684604051613524919061410c565b6000604051808303816000865af19150503d8060008114613561576040519150601f19603f3d011682016040523d82523d6000602084013e613566565b606091505b50915091508180156135905750805115806135905750808060200190518101906135909190613dd3565b80156135a557506001600160a01b0385163b15155b95945050505050565b600054610100900460ff1661362b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e61381f565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b600054610100900460ff16611ec55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b6060824710156137a55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d65565b600080866001600160a01b031685876040516137c1919061410c565b60006040518083038185875af1925050503d80600081146137fe576040519150601f19603f3d011682016040523d82523d6000602084013e613803565b606091505b5091509150613814878383876138a5565b979650505050505050565b600054610100900460ff1661389c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e336124cc565b6060831561391457825160000361390d576001600160a01b0385163b61390d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d65565b50816134ff565b6134ff83838151156139295781518083602001fd5b8060405162461bcd60e51b8152600401610d659190614128565b6001600160a01b038116811461057357600080fd5b60006020828403121561396a57600080fd5b8135610c8581613943565b60008060006060848603121561398a57600080fd5b83359250602084013561399c81613943565b915060408401356139ac81613943565b809150509250925092565b600080600080600060a086880312156139cf57600080fd5b853594506020860135935060408601356139e881613943565b925060608601356139f881613943565b91506080860135613a0881613943565b809150509295509295909350565b600080600060608486031215613a2b57600080fd5b8335613a3681613943565b92506020840135613a4681613943565b929592945050506040919091013590565b600060208284031215613a6957600080fd5b5035919050565b60008060408385031215613a8357600080fd5b8235613a8e81613943565b91506020830135613a9e81613943565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613b0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c856020830184613ad8565b60008083601f840112613b3957600080fd5b50813567ffffffffffffffff811115613b5157600080fd5b6020830191508360208260061b8501011115613b6c57600080fd5b9250929050565b600080600080600060608688031215613b8b57600080fd5b8535613b9681613943565b9450602086013567ffffffffffffffff80821115613bb357600080fd5b818801915088601f830112613bc757600080fd5b813581811115613bd657600080fd5b8960208260051b8501011115613beb57600080fd5b602083019650809550506040880135915080821115613c0957600080fd5b50613c1688828901613b27565b969995985093965092949392505050565b60008060008385036080811215613c3d57600080fd5b8435613c4881613943565b93506020850135613c5881613943565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613c8a57600080fd5b506040840190509250925092565b600080600080600060a08688031215613cb057600080fd5b8535613cbb81613943565b94506020860135613ccb81613943565b93506040860135613cdb81613943565b92506060860135613ceb81613943565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176123c5576123c5613cfc565b600060208284031215613d5457600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613d9c57600080fd5b813560048110610c8557600080fd5b8481526020810184905260808101613dc66040830185613ad8565b6135a56060830184613ad8565b600060208284031215613de557600080fd5b81518015158114610c8557600080fd5b808201808211156123c5576123c5613cfc565b600082613e3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015613e5e578181015183820152602001613e46565b50506000910152565b60008151808452613e7f816020860160208601613e43565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134ff6040830184613e67565b60006001600160a01b038086168352808516602084015250606060408301526135a56060830184613e67565b818103818111156123c5576123c5613cfc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f8857613f88613f12565b604052919050565b600067ffffffffffffffff821115613faa57613faa613f12565b5060051b60200190565b600082601f830112613fc557600080fd5b81516020613fda613fd583613f90565b613f41565b8083825260208201915060208460051b870101935086841115613ffc57600080fd5b602086015b848110156140185780518352918301918301614001565b509695505050505050565b6000806040838503121561403657600080fd5b825167ffffffffffffffff8082111561404e57600080fd5b818501915085601f83011261406257600080fd5b81516020614072613fd583613f90565b82815260059290921b8401810191818101908984111561409157600080fd5b948201945b838610156140b85785516140a981613943565b82529482019490820190614096565b918801519196509093505050808211156140d157600080fd5b506140de85828601613fb4565b9150509250929050565b600080604083850312156140fb57600080fd5b505080516020909101519092909150565b6000825161411e818460208701613e43565b9190910192915050565b6020815260006123c26020830184613e6756fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a26469706673582212207e09b2851b53f45e06f0d26515bd281b9d3817c41e4298fc7d827cf832aaa9d064736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061025c5760003560e01c806379ba509711610145578063ca325469116100bd578063f04c31871161008c578063f2fde38b11610071578063f2fde38b14610533578063f7013ef614610546578063fe3da9841461055957600080fd5b8063f04c31871461050d578063f0dc7e9d1461052057600080fd5b8063ca325469146104c6578063cdf456e1146104d9578063e2ff7ea2146104ed578063e30c3978146104fc57600080fd5b8063b491ddf711610114578063b6828c57116100f9578063b6828c5714610498578063bc368b04146104ab578063c0654646146104b357600080fd5b8063b491ddf714610444578063b4a0bdf31461048757600080fd5b806379ba5097146104055780638da5cb5b1461040d57806390fa7b541461041e578063aac59a751461043157600080fd5b8063530e784f116101d85780636daa463b116101a757806370a082311161018c57806370a08231146103c9578063715018a6146103ea578063746460a9146103f257600080fd5b80636daa463b146103a35780636f1a30a8146103b657600080fd5b8063530e784f1461036257806358b904df146103755780635e1e63251461037d57806364aff9ec1461039057600080fd5b80630e32cb861161022f5780633606b26c116102145780633606b26c14610329578063439727a51461033c57806352e21a181461034f57600080fd5b80630e32cb86146103035780632630c12f1461031657600080fd5b806301e201781461026157806307aa239e146102915780630a0a05e6146102c65780630a9a2b72146102db575b600080fd5b60ff54610274906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b60fe546102b69074010000000000000000000000000000000000000000900460ff1681565b6040519015158152602001610288565b6102d96102d4366004613958565b610562565b005b6102ee6102e9366004613975565b610576565b60408051928352602083019190915201610288565b6102d9610311366004613958565b610624565b60fc54610274906001600160a01b031681565b6102d9610337366004613958565b610635565b6102ee61034a3660046139b7565b610646565b6102d961035d366004613958565b610784565b6102d9610370366004613958565b610795565b6102d96107a6565b6102ee61038b366004613975565b61088c565b6102d961039e366004613a16565b61095a565b6102ee6103b1366004613975565b6109f7565b6102ee6103c4366004613975565b610b00565b6103dc6103d7366004613958565b610bff565b604051908152602001610288565b6102d9610c8c565b6102d9610400366004613a57565b610ca0565b6102d9610ce7565b6033546001600160a01b0316610274565b6102ee61042c3660046139b7565b610d77565b6102d961043f366004613a70565b610e61565b610479610452366004613a70565b60fd6020908152600092835260408084209091529082529020805460019091015460ff1682565b604051610288929190613b13565b6097546001600160a01b0316610274565b6102ee6104a63660046139b7565b610e97565b6102d9610f81565b6102d96104c1366004613b73565b611033565b60fe54610274906001600160a01b031681565b61012d54610274906001600160a01b031681565b6103dc6706f05b59d3b2000081565b6065546001600160a01b0316610274565b6102ee61051b3660046139b7565b6110d1565b6102d961052e366004613c27565b6111f4565b6102d9610541366004613958565b611593565b6102d9610554366004613c98565b61161c565b6103dc60fb5481565b61056a6117a6565b61057381611800565b50565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156105b8576105b8613aa9565b036105ef576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105fa84610bff565b905085811015610608578095505b85925061061686868661187d565b508092505050935093915050565b61062c6117a6565b61057381611be3565b61063d6117a6565b61057381611cd8565b600080828585610654611d57565b61065d83611dac565b816001600160a01b0316836001600160a01b0316148061068e5750806001600160a01b0316836001600160a01b0316145b156106c5576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106cd611dec565b6106da8a8a8a8a8a611e45565b9095509350898514610718576040517fc214279600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f795a235be939acb902ac69562805f86e1341a9b019c351b996e2aa2dfc34c67c906060015b60405180910390a4610777600160c955565b5050509550959350505050565b61078c6117a6565b61057381611ecc565b61079d6117a6565b61057381611f49565b6107e46040518060400160405280601281526020017f726573756d65436f6e76657273696f6e28290000000000000000000000000000815250611fc6565b60fe5474010000000000000000000000000000000000000000900460ff16610837576040517e6d8dbb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905560405133907f89b79206f08dadd78502cff5075d2b094fa0abea0b063cfafe4475e2a380c51f90600090a2565b60008060026001600160a01b03808616600090815260fd602090815260408083209388168352929052206001015460ff1660038111156108ce576108ce613aa9565b03610905576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8491506000610915868686612092565b9092509050600061092585610bff565b9050828110156109505761094a610944670de0b6b3a764000083613d2b565b8361239f565b93508092505b5050935093915050565b6109626117a6565b61096a611dec565b61097383611dac565b61097c82611dac565b610985816123cb565b8261099a6001600160a01b0382168484612405565b826001600160a01b0316846001600160a01b03167f6d25be279134f4ecaa4770aff0c3d916d9e7c5ef37b65ed95dbdba411f5d54d5846040516109df91815260200190565b60405180910390a3506109f2600160c955565b505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610a5b57600080fd5b505af1158015610a6f573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610ad357600080fd5b505af1158015610ae7573d6000803e3d6000fd5b50505050610af6858585612092565b5094959350505050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038481166004830152600092839291169063b62cad6990602401600060405180830381600087803b158015610b6457600080fd5b505af1158015610b78573d6000803e3d6000fd5b505060fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038781166004830152909116925063b62cad699150602401600060405180830381600087803b158015610bdc57600080fd5b505af1158015610bf0573d6000803e3d6000fd5b50505050610af685858561187d565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038216906370a0823190602401602060405180830381865afa158015610c61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c859190613d42565b9392505050565b610c946117a6565b610c9e60006124cc565b565b610cde6040518060400160405280601e81526020017f7365744d696e416d6f756e74546f436f6e766572742875696e74323536290000815250611fc6565b610573816124fd565b60655433906001600160a01b03168114610d6e5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610573816124cc565b600080828585610d85611d57565b610d8e83611dac565b816001600160a01b0316836001600160a01b03161480610dbf5750806001600160a01b0316836001600160a01b0316145b15610df6576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610dfe611dec565b610e0b8a8a8a8a8a611e45565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f93b7ba2a2b0e36320375853d7466af5685c07567804b871b4fdfd31e3bb7715490606001610765565b610e69611dec565b6000610e758383612547565b90508015610e8857610e8883838361265c565b50610e93600160c955565b5050565b600080828585610ea5611d57565b610eae83611dac565b816001600160a01b0316836001600160a01b03161480610edf5750806001600160a01b0316836001600160a01b0316145b15610f16576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f1e611dec565b610f2b8a8a8a8a8a612ab1565b9095509350604080516001600160a01b038a81168252602082018890529181018690528189169188169033907f9b7dc1d7d2974d015b4fc39889a09f3a3923add808f5863158f3162d997d4e8290606001610765565b610fbf6040518060400160405280601181526020017f7061757365436f6e76657273696f6e2829000000000000000000000000000000815250611fc6565b610fc7611d57565b60fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905560405133907f490bc639fd0d96f19c8adf77bc98d17fbefdee2e1e1864d21f041360d0ee065a90600090a2565b8281811461106d576040517f4d5590f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156110c8576110c08787878481811061108e5761108e613d5b565b90506020020160208101906110a39190613958565b8686858181106110b5576110b5613d5b565b9050604002016111f4565b600101611070565b50505050505050565b6000808285856110df611d57565b6110e883611dac565b816001600160a01b0316836001600160a01b031614806111195750806001600160a01b0316836001600160a01b0316145b15611150576040517f8aa3a72f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611158611dec565b6111658a8a8a8a8a612b43565b90955093508884146111a3576040517fa8dc653c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b604080516001600160a01b038a81168252602082018890529181018690528189169188169033907fcb4ea7de8d069b0f443b792cba6c6df5096508951bbc75c04ac42c9251efe07690606001610765565b61121560405180606001604052806035815260200161413c60359139611fc6565b61121e83611dac565b61122782611dac565b6706f05b59d3b200008135111561127b576040517f9770caee000000000000000000000000000000000000000000000000000000008152813560048201526706f05b59d3b200006024820152604401610d65565b816001600160a01b0316836001600160a01b031614806112aa575061012d546001600160a01b03848116911614155b806112f2575060006001600160a01b03808416600090815260fd602090815260408083209388168352929052206001015460ff1660038111156112ef576112ef613aa9565b14155b15611329576040517feebb5ac600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600261133b6040830160208401613d8a565b600381111561134c5761134c613aa9565b1480156113595750803515155b15611390576040517fd0d4aabe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026113a26040830160208401613d8a565b60038111156113b3576113b3613aa9565b14806113df575060016113cc6040830160208401613d8a565b60038111156113dd576113dd613aa9565b145b80156113f4575060ff546001600160a01b0316155b1561142b576040517fe7c2c99400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808416600081815260fd602090815260408083209487168084529482529182902080546001820154919594937f39fbfdd5da133303ed31b1b65e30a0ddf7a9236573368c66c859dceccc1dd12a93919288359260ff9091169161149b91908a01908a01613d8a565b6040516114ab9493929190613dab565b60405180910390a360006114c56040840160208501613d8a565b60038111156114d6576114d6613aa9565b03611533576001600160a01b03808516600090815260fd60209081526040808320938716835292905290812090815560010180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905561158d565b813581556115476040830160208401613d8a565b6001808301805490917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091169083600381111561158757611587613aa9565b02179055505b50505050565b61159b6117a6565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556115e46033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600054610100900460ff161580801561163c5750600054600160ff909116105b806116565750303b158015611656575060005460ff166001145b6116c85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610d65565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561172657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61172f83611cd8565b61173b86868685612c00565b801561179e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050565b6033546001600160a01b03163314610c9e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d65565b61180981611dac565b60fe546040516001600160a01b038084169216907f9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b90600090a360fe80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b600080846000036118ba576040517f42301c2300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561190e5761190e613aa9565b600381111561191f5761191f613aa9565b905250905060008160200151600381111561193c5761193c613aa9565b03611973576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb9190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015611a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a889190613d42565b835160ff54919250906000906001600160a01b031615801590611b2b575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015611b07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b2b9190613dd3565b90508015611b3857600091505b6000611b4c83670de0b6b3a7640000613df5565b90508115611b8c57611b5e8186613d2b565b670de0b6b3a7640000611b71868e613d2b565b611b7b9190613d2b565b611b859190613e08565b9750611bbe565b611bbb670de0b6b3a7640000611ba2868e613d2b565b611bac9190613d2b565b611bb68388613d2b565b61239f565b97505b83611bc98287613d2b565b611bd39190613e08565b9650505050505050935093915050565b6001600160a01b038116611c5f5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610d65565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0910160405180910390a15050565b611ce181611dac565b61012d546040516001600160a01b038084169216907f4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f4290600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60fe5474010000000000000000000000000000000000000000900460ff1615610c9e576040517f952bcf7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038116610573576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260c95403611e3e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610d65565b600260c955565b600080611e528585612c99565b611e5c8588612db9565b9150611e698286866109f7565b91505085811015611eb0576040517f228f8c110000000000000000000000000000000000000000000000000000000081526004810182905260248101879052604401610d65565b611ebb848483612f04565b9550959350505050565b600160c955565b611ed581611dac565b60ff546040516001600160a01b038084169216907f50f1a16bf24734355b14ff800d132cc0a934808b8621d5623b41bc67f204881790600090a360ff80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611f5281611dac565b60fc546040516001600160a01b038084169216907f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd90600090a360fc80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906120129033908690600401613eb1565b602060405180830381865afa15801561202f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120539190613dd3565b905080610e93573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610d6593929190613ed3565b600080846000036120cf576040517f098fb56100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03808516600090815260fd6020908152604080832093871683529281528282208351808501909452805484526001810154929392909183019060ff16600381111561212357612123613aa9565b600381111561213457612134613aa9565b905250905060008160200151600381111561215157612151613aa9565b03612188576040517f618ce59700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015260009216906341976e0990602401602060405180830381865afa1580156121ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122109190613d42565b60fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152929350600092909116906341976e0990602401602060405180830381865afa158015612279573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061229d9190613d42565b835160ff54919250906001600160a01b03161580159061233d575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233d9190613dd3565b15612346575060005b600061235a82670de0b6b3a7640000613df5565b9050826123678286613d2b565b6123719190613e08565b9550670de0b6b3a7640000612386878c613d2b565b6123909190613e08565b96505050505050935093915050565b60008160016123ae8286613df5565b6123b89190613eff565b6123c29190613e08565b90505b92915050565b80600003610573576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b0383166024820152604481018290526109f29084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612f67565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556105738161304f565b612506816123cb565b60fb5460408051918252602082018390527fada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d910160405180910390a160fb55565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600090829082906001600160a01b038316906370a0823190602401602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf9190613d42565b61012d549093508391506001600160a01b03908116908516036126545760fe546000935061260a906001600160a01b03848116911683612405565b60fe546040518281526001600160a01b0386811692888216929116907fadc20ad416881f76b4304665c35f5be8592297bcdfe4f0bb087b9d254222af559060200160405180910390a45b505092915050565b600061267161012d546001600160a01b031690565b60fe5460ff549192506001600160a01b03908116916000911615612aac5760ff546040517f4e9f8f390000000000000000000000000000000000000000000000000000000081526001600160a01b03878116600483015285811660248301526000928392911690634e9f8f39906044016000604051808303816000875af1158015612700573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526127469190810190614023565b8151919350915060005b81811015612aa75782818151811061276a5761276a613d5b565b602002602001015160000315612aa757600084828151811061278e5761278e613d5b565b60200260200101516001600160a01b0316636f1a30a88584815181106127b6576127b6613d5b565b60200260200101518c8b6040518463ffffffff1660e01b81526004016127f8939291909283526001600160a01b03918216602084015216604082015260600190565b60408051808303816000875af1158015612816573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061283a91906140e8565b915050888111156128485750875b612852818b6130b9565b61285c5750612aa7565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038881166004830152600091908a16906370a0823190602401602060405180830381865afa1580156128bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128e39190613d42565b905061291c8684815181106128fa576128fa613d5b565b6020026020010151838d6001600160a01b03166131f19092919063ffffffff16565b85838151811061292e5761292e613d5b565b60209081029190910101516040517f439727a500000000000000000000000000000000000000000000000000000000815260048101849052600060248201526001600160a01b038d811660448301528b811660648301528a811660848301529091169063439727a59060a40160408051808303816000875af11580156129b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129dc91906140e8565b50506040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b038981166004830152600091908b16906370a0823190602401602060405180830381865afa158015612a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a659190613d42565b9050612a71838c613eff565b9a50612a7d8282613eff565b612a879089613df5565b97508a600003612a9957505050612aa7565b836001019350505050612750565b505050505b61179e565b600080612abe8585612c99565b6000612acb878787610b00565b91505087811115612b12576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612b1c8682612db9565b9250612b298387876109f7565b9250612b389050858584612f04565b509550959350505050565b600080612b508585612c99565b6000612b5d878787610b00565b915050612b6a8682612db9565b9250808314612ba5576040517f0c5c1c2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b87831115612be9576040517f71b5f0c10000000000000000000000000000000000000000000000000000000081526004810182905260248101899052604401610d65565b612bf4858589612f04565b50909694955050505050565b600054610100900460ff16612c7d5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b612c86846132c7565b612c8e613355565b61158d8383836133da565b60ff546000906001600160a01b031615801590612d36575060ff546040517f6c059fb10000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0390911690636c059fb190602401602060405180830381865afa158015612d12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d369190613dd3565b905080158015612d82575060026001600160a01b03808516600090815260fd602090815260408083209387168352929052206001015460ff166003811115612d8057612d80613aa9565b145b156109f2576040517f03410cd100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600091849183918316906370a0823190602401602060405180830381865afa158015612e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e469190613d42565b60fe54909150612e65906001600160a01b03848116913391168761349f565b60fe546040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201526000918416906370a0823190602401602060405180830381865afa158015612eca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612eee9190613d42565b9050612efa8282613eff565b9695505050505050565b6000612f0f84610bff565b905081811015612f4b576040517f6bb2792900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83612f606001600160a01b0382168585612405565b5050505050565b6000612fbc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134f09092919063ffffffff16565b9050805160001480612fdd575080806020019051810190612fdd9190613dd3565b6109f25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610d65565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60fc546040517fb62cad690000000000000000000000000000000000000000000000000000000081526001600160a01b038381166004830152600092169063b62cad6990602401600060405180830381600087803b15801561311a57600080fd5b505af115801561312e573d6000803e3d6000fd5b505060fc546040517f41976e090000000000000000000000000000000000000000000000000000000081526001600160a01b03868116600483015260009450670de0b6b3a76400009350879216906341976e0990602401602060405180830381865afa1580156131a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131c69190613d42565b6131d09190613d2b565b6131da9190613e08565b905060fb5481106131ea57600191505b5092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f095ea7b3000000000000000000000000000000000000000000000000000000001790526132708482613507565b61158d576040516001600160a01b0384166024820152600060448201526132bd9085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161244a565b61158d8482612f67565b600054610100900460ff166133445760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61334c6135ae565b61057381613633565b600054610100900460ff166133d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e6136b0565b600054610100900460ff166134575760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b61346083611f49565b61346982611800565b613472816124fd565b505060fe80547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16905550565b6040516001600160a01b038085166024830152831660448201526064810182905261158d9085907f23b872dd000000000000000000000000000000000000000000000000000000009060840161244a565b60606134ff848460008561372d565b949350505050565b6000806000846001600160a01b031684604051613524919061410c565b6000604051808303816000865af19150503d8060008114613561576040519150601f19603f3d011682016040523d82523d6000602084013e613566565b606091505b50915091508180156135905750805115806135905750808060200190518101906135909190613dd3565b80156135a557506001600160a01b0385163b15155b95945050505050565b600054610100900460ff1661362b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e61381f565b600054610100900460ff1661062c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b600054610100900460ff16611ec55760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b6060824710156137a55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d65565b600080866001600160a01b031685876040516137c1919061410c565b60006040518083038185875af1925050503d80600081146137fe576040519150601f19603f3d011682016040523d82523d6000602084013e613803565b606091505b5091509150613814878383876138a5565b979650505050505050565b600054610100900460ff1661389c5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610d65565b610c9e336124cc565b6060831561391457825160000361390d576001600160a01b0385163b61390d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d65565b50816134ff565b6134ff83838151156139295781518083602001fd5b8060405162461bcd60e51b8152600401610d659190614128565b6001600160a01b038116811461057357600080fd5b60006020828403121561396a57600080fd5b8135610c8581613943565b60008060006060848603121561398a57600080fd5b83359250602084013561399c81613943565b915060408401356139ac81613943565b809150509250925092565b600080600080600060a086880312156139cf57600080fd5b853594506020860135935060408601356139e881613943565b925060608601356139f881613943565b91506080860135613a0881613943565b809150509295509295909350565b600080600060608486031215613a2b57600080fd5b8335613a3681613943565b92506020840135613a4681613943565b929592945050506040919091013590565b600060208284031215613a6957600080fd5b5035919050565b60008060408385031215613a8357600080fd5b8235613a8e81613943565b91506020830135613a9e81613943565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613b0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b9052565b82815260408101610c856020830184613ad8565b60008083601f840112613b3957600080fd5b50813567ffffffffffffffff811115613b5157600080fd5b6020830191508360208260061b8501011115613b6c57600080fd5b9250929050565b600080600080600060608688031215613b8b57600080fd5b8535613b9681613943565b9450602086013567ffffffffffffffff80821115613bb357600080fd5b818801915088601f830112613bc757600080fd5b813581811115613bd657600080fd5b8960208260051b8501011115613beb57600080fd5b602083019650809550506040880135915080821115613c0957600080fd5b50613c1688828901613b27565b969995985093965092949392505050565b60008060008385036080811215613c3d57600080fd5b8435613c4881613943565b93506020850135613c5881613943565b925060407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc082011215613c8a57600080fd5b506040840190509250925092565b600080600080600060a08688031215613cb057600080fd5b8535613cbb81613943565b94506020860135613ccb81613943565b93506040860135613cdb81613943565b92506060860135613ceb81613943565b949793965091946080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176123c5576123c5613cfc565b600060208284031215613d5457600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215613d9c57600080fd5b813560048110610c8557600080fd5b8481526020810184905260808101613dc66040830185613ad8565b6135a56060830184613ad8565b600060208284031215613de557600080fd5b81518015158114610c8557600080fd5b808201808211156123c5576123c5613cfc565b600082613e3e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015613e5e578181015183820152602001613e46565b50506000910152565b60008151808452613e7f816020860160208601613e43565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b03831681526040602082015260006134ff6040830184613e67565b60006001600160a01b038086168352808516602084015250606060408301526135a56060830184613e67565b818103818111156123c5576123c5613cfc565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613f8857613f88613f12565b604052919050565b600067ffffffffffffffff821115613faa57613faa613f12565b5060051b60200190565b600082601f830112613fc557600080fd5b81516020613fda613fd583613f90565b613f41565b8083825260208201915060208460051b870101935086841115613ffc57600080fd5b602086015b848110156140185780518352918301918301614001565b509695505050505050565b6000806040838503121561403657600080fd5b825167ffffffffffffffff8082111561404e57600080fd5b818501915085601f83011261406257600080fd5b81516020614072613fd583613f90565b82815260059290921b8401810191818101908984111561409157600080fd5b948201945b838610156140b85785516140a981613943565b82529482019490820190614096565b918801519196509093505050808211156140d157600080fd5b506140de85828601613fb4565b9150509250929050565b600080604083850312156140fb57600080fd5b505080516020909101519092909150565b6000825161411e818460208701613e43565b9190910192915050565b6020815260006123c26020830184613e6756fe736574436f6e76657273696f6e436f6e66696728616464726573732c616464726573732c436f6e76657273696f6e436f6e66696729a26469706673582212207e09b2851b53f45e06f0d26515bd281b9d3817c41e4298fc7d827cf832aaa9d064736f6c63430008190033", + "devdoc": { + "author": "Venus", + "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "balanceOf(address)": { + "params": { + "tokenAddress": "Address of the token" + }, + "returns": { + "tokenBalance": "Balance of the token the contract has" + } + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor" + }, + "convertExactTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissaAmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa", + "custom:event": "Emits ConvertedExactTokens event on success", + "details": "Method does not support deflationary tokens transfer", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "amountOutMinMantissa": "Min amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa", + "custom:event": "Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "amountOutMinMantissa": "Min amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "convertForExactTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissaAmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa", + "custom:event": "Emits ConvertedForExactTokens event on success", + "details": "Method does not support deflationary tokens transfer", + "params": { + "amountInMaxMantissa": "Max amount of tokenAddressIn", + "amountOutMantissa": "Amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when to address is zeroInvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOutAmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa", + "custom:event": "Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success", + "params": { + "amountInMaxMantissa": "Max amount of tokenAddressIn", + "amountOutMantissa": "Amount of tokenAddressOut required as output", + "to": "Address of the tokenAddressOut receiver", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "actualAmountIn": "Actual amount transferred to destination", + "actualAmountOut": "Actual amount transferred to user" + } + }, + "getAmountIn(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion", + "details": "This function retrieves values without altering token prices", + "params": { + "amountOutMantissa": "Amount of tokenAddressOut user wants to receive", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressOut should be transferred after conversion", + "amountInMantissa": "Amount of the tokenAddressIn sender would send to contract before conversion" + } + }, + "getAmountOut(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pairConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion", + "details": "This function retrieves values without altering token prices", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressIn should be transferred after conversion", + "amountOutMantissa": "Amount of the tokenAddressOut sender should receive after conversion" + } + }, + "getUpdatedAmountIn(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair", + "params": { + "amountOutMantissa": "Amount of tokenAddressOut user wants to receive", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressOut should be transferred after conversion", + "amountInMantissa": "Amount of the tokenAddressIn sender would send to contract before conversion" + } + }, + "getUpdatedAmountOut(uint256,address,address)": { + "custom:error": "InsufficientInputAmount error is thrown when given input amount is zeroConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair", + "params": { + "amountInMantissa": "Amount of tokenAddressIn", + "tokenAddressIn": "Address of the token to convert", + "tokenAddressOut": "Address of the token to get after conversion" + }, + "returns": { + "amountConvertedMantissa": "Amount of tokenAddressIn should be transferred after conversion", + "amountOutMantissa": "Amount of the tokenAddressOut sender should receive after conversion" + } + }, + "initialize(address,address,address,address,uint256)": { + "params": { + "accessControlManager_": "Access control manager contract address", + "baseAsset_": "Address of the base asset", + "destinationAddress_": "Address at all incoming tokens will transferred to", + "minAmountToConvert_": "Minimum amount to convert", + "priceOracle_": "Resilient oracle address" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pauseConversion()": { + "custom:access": "Restricted by ACM", + "custom:error": "ConversionTokensPaused thrown when conversion is already paused", + "custom:event": "Emits ConversionPaused on success" + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "resumeConversion()": { + "custom:access": "Restricted by ACM", + "custom:error": "ConversionTokensActive thrown when conversion is already active", + "custom:event": "Emits ConversionResumed on success" + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setBaseAsset(address)": { + "custom:access": "Only Governance", + "params": { + "baseAsset_": "The new address of the base asset" + } + }, + "setConversionConfig(address,address,(uint256,uint8))": { + "custom:access": "Controlled by AccessControlManager", + "custom:error": "Unauthorized error is thrown when the call is not authorized by AccessControlManagerZeroAddressNotAllowed is thrown when pool registry address is zeroNonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion", + "custom:event": "Emits ConversionConfigUpdated event on success", + "params": { + "conversionConfig": "ConversionConfig config details to update", + "tokenAddressIn": "Address of tokenIn", + "tokenAddressOut": "Address of tokenOut" + } + }, + "setConversionConfigs(address,address[],(uint256,uint8)[])": { + "custom:error": "InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches", + "params": { + "conversionConfigs": "Array of conversionConfig config details to update", + "tokenAddressIn": "Address of tokenIn", + "tokenAddressesOut": "Array of addresses of tokenOut" + } + }, + "setConverterNetwork(address)": { + "custom:access": "Only Governance", + "params": { + "converterNetwork_": "The converterNetwork address to be set" + } + }, + "setDestination(address)": { + "custom:access": "Only Governance", + "params": { + "destinationAddress_": "The new destination address to be set" + } + }, + "setMinAmountToConvert(uint256)": { + "custom:access": "Only Governance", + "params": { + "minAmountToConvert_": "Min amount to convert" + } + }, + "setPriceOracle(address)": { + "custom:access": "Only Governance", + "params": { + "priceOracle_": "Address of the new price oracle to set" + } + }, + "sweepToken(address,address,uint256)": { + "custom:access": "Only Governance", + "custom:error": "ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero", + "custom:event": "Emits SweepToken event on success", + "params": { + "amount": "The amount to transfer", + "to": "The address to which tokens will be transferred", + "tokenAddress": "The address of the ERC-20 token to sweep" + } + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + }, + "updateAssetsState(address,address)": { + "details": "This function is called by protocolShareReservecall _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address", + "params": { + "asset": "Asset address", + "comptroller": "Comptroller address (pool)" + } + } + }, + "title": "SingleTokenConverter", + "version": 1 + }, + "userdoc": { + "errors": { + "AmountInHigherThanMax(uint256,uint256)": [ + { + "notice": "Thrown when amountIn is higher than amountInMax" + } + ], + "AmountInMismatched()": [ + { + "notice": "Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens" + } + ], + "AmountOutLowerThanMinRequired(uint256,uint256)": [ + { + "notice": "Thrown when amountOut is lower than amountOutMin" + } + ], + "AmountOutMismatched()": [ + { + "notice": "Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens" + } + ], + "ConversionConfigNotEnabled()": [ + { + "notice": "Thrown when conversion is disabled or config does not exist for given pair" + } + ], + "ConversionEnabledOnlyForPrivateConversions()": [ + { + "notice": "Thrown when conversion is enabled only for private conversions" + } + ], + "ConversionTokensActive()": [ + { + "notice": "Thrown when conversion is Active" + } + ], + "ConversionTokensPaused()": [ + { + "notice": "Thrown when conversion is paused" + } + ], + "DeflationaryTokenNotSupported()": [ + { + "notice": "Thrown when using convertForExactTokens deflationary tokens" + } + ], + "IncentiveTooHigh(uint256,uint256)": [ + { + "notice": "Thrown when incentive is higher than the MAX_INCENTIVE" + } + ], + "InputLengthMisMatch()": [ + { + "notice": "Thrown when there is a mismatch in the length of input arrays" + } + ], + "InsufficientInputAmount()": [ + { + "notice": "Thrown when given input amount is zero" + } + ], + "InsufficientOutputAmount()": [ + { + "notice": "Thrown when given output amount is zero" + } + ], + "InsufficientPoolLiquidity()": [ + { + "notice": "Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa" + } + ], + "InvalidConverterNetwork()": [ + { + "notice": "When address of the ConverterNetwork is not set or Zero address" + } + ], + "InvalidMinimumAmountToConvert()": [ + { + "notice": "Thrown when minimum amount to convert is zero" + } + ], + "InvalidToAddress()": [ + { + "notice": "Thrown when address(to) is same as tokenAddressIn or tokenAddressOut" + } + ], + "InvalidTokenConfigAddresses()": [ + { + "notice": "Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination" + } + ], + "NonZeroIncentiveForPrivateConversion()": [ + { + "notice": "Thrown when trying to set non zero incentive for private conversion" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ], + "ZeroValueNotAllowed()": [ + { + "notice": "Thrown if the supplied value is 0 where it is not allowed" + } + ] + }, + "events": { + "AssetTransferredToDestination(address,address,address,uint256)": { + "notice": "Emmitted after the funds transferred to the destination address" + }, + "BaseAssetUpdated(address,address)": { + "notice": "Emitted when base asset is updated" + }, + "ConversionConfigUpdated(address,address,uint256,uint256,uint8,uint8)": { + "notice": "Emitted when config is updated for tokens pair" + }, + "ConversionPaused(address)": { + "notice": "Emitted when conversion is paused" + }, + "ConversionResumed(address)": { + "notice": "Emitted when conversion is unpaused" + }, + "ConvertedExactTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when exact amount of tokens are converted for tokens" + }, + "ConvertedExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when exact amount of tokens are converted for tokens, for deflationary tokens" + }, + "ConvertedForExactTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when tokens are converted for exact amount of tokens" + }, + "ConvertedForExactTokensSupportingFeeOnTransferTokens(address,address,address,address,uint256,uint256)": { + "notice": "Emitted when tokens are converted for exact amount of tokens, for deflationary tokens" + }, + "ConverterNetworkAddressUpdated(address,address)": { + "notice": "Emitted when converterNetwork address is updated" + }, + "DestinationAddressUpdated(address,address)": { + "notice": "Emitted when destination address is updated" + }, + "MinAmountToConvertUpdated(uint256,uint256)": { + "notice": "Emitted when minimum amount to convert is updated" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + }, + "PriceOracleUpdated(address,address)": { + "notice": "Emitted when price oracle address is updated" + }, + "SweepToken(address,address,uint256)": { + "notice": "Event emitted when tokens are swept" + } + }, + "kind": "user", + "methods": { + "MAX_INCENTIVE()": { + "notice": "Maximum incentive could be" + }, + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "balanceOf(address)": { + "notice": "Get the balance for specific token" + }, + "baseAsset()": { + "notice": "Address of the base asset token" + }, + "conversionConfigurations(address,address)": { + "notice": "conversion configurations for the existing pairs" + }, + "conversionPaused()": { + "notice": "Boolean for if conversion is paused" + }, + "convertExactTokens(uint256,uint256,address,address,address)": { + "notice": "Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract" + }, + "convertExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "notice": "Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract" + }, + "convertForExactTokens(uint256,uint256,address,address,address)": { + "notice": "Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract, otherwise the amount is adjusted" + }, + "convertForExactTokensSupportingFeeOnTransferTokens(uint256,uint256,address,address,address)": { + "notice": "Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted. The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens" + }, + "converterNetwork()": { + "notice": "Address of the converterNetwork contract" + }, + "destinationAddress()": { + "notice": "Address that all incoming tokens are transferred to" + }, + "getAmountIn(uint256,address,address)": { + "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut. This function does not account for potential token transfer fees(in case of deflationary tokens)" + }, + "getAmountOut(uint256,address,address)": { + "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn. This function does not account for potential token transfer fees(in case of deflationary tokens)The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut" + }, + "getUpdatedAmountIn(uint256,address,address)": { + "notice": "To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut" + }, + "getUpdatedAmountOut(uint256,address,address)": { + "notice": "To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn" + }, + "minAmountToConvert()": { + "notice": "Min amount to convert for private conversions. Defined in USD, with 18 decimals" + }, + "pauseConversion()": { + "notice": "Pause conversion of tokens" + }, + "priceOracle()": { + "notice": "Venus price oracle contract" + }, + "resumeConversion()": { + "notice": "Resume conversion of tokens." + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "setBaseAsset(address)": { + "notice": "Sets the base asset for the contract" + }, + "setConversionConfig(address,address,(uint256,uint8))": { + "notice": "Set the configuration for new or existing conversion pair" + }, + "setConversionConfigs(address,address[],(uint256,uint8)[])": { + "notice": "Batch sets the conversion configurations" + }, + "setConverterNetwork(address)": { + "notice": "Sets a converter network contract address" + }, + "setDestination(address)": { + "notice": "Sets a new destination address" + }, + "setMinAmountToConvert(uint256)": { + "notice": "Min amount to convert setter" + }, + "setPriceOracle(address)": { + "notice": "Sets a new price oracle" + }, + "sweepToken(address,address,uint256)": { + "notice": "To sweep ERC20 tokens and transfer them to user(to address)" + }, + "updateAssetsState(address,address)": { + "notice": "This method updated the states of this contract after getting funds from PSR after settling the amount(if any) through privateConversion between converters" + } + }, + "notice": "SingleTokenConverter used for token conversions and sends received tokens", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 547, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "_status", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 616, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 9976, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "minAmountToConvert", + "offset": 0, + "slot": "251", + "type": "t_uint256" + }, + { + "astId": 9980, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "priceOracle", + "offset": 0, + "slot": "252", + "type": "t_contract(ResilientOracle)6494" + }, + { + "astId": 9988, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "conversionConfigurations", + "offset": 0, + "slot": "253", + "type": "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)12709_storage))" + }, + { + "astId": 9991, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "destinationAddress", + "offset": 0, + "slot": "254", + "type": "t_address" + }, + { + "astId": 9994, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "conversionPaused", + "offset": 20, + "slot": "254", + "type": "t_bool" + }, + { + "astId": 9998, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "converterNetwork", + "offset": 0, + "slot": "255", + "type": "t_contract(IConverterNetwork)6767" + }, + { + "astId": 10003, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "__gap", + "offset": 0, + "slot": "256", + "type": "t_array(t_uint256)45_storage" + }, + { + "astId": 14059, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "baseAsset", + "offset": 0, + "slot": "301", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)45_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[45]", + "numberOfBytes": "1440" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_contract(IConverterNetwork)6767": { + "encoding": "inplace", + "label": "contract IConverterNetwork", + "numberOfBytes": "20" + }, + "t_contract(ResilientOracle)6494": { + "encoding": "inplace", + "label": "contract ResilientOracle", + "numberOfBytes": "20" + }, + "t_enum(ConversionAccessibility)12700": { + "encoding": "inplace", + "label": "enum IAbstractTokenConverter.ConversionAccessibility", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_address,t_struct(ConversionConfig)12709_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => struct IAbstractTokenConverter.ConversionConfig))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_struct(ConversionConfig)12709_storage)" + }, + "t_mapping(t_address,t_struct(ConversionConfig)12709_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct IAbstractTokenConverter.ConversionConfig)", + "numberOfBytes": "32", + "value": "t_struct(ConversionConfig)12709_storage" + }, + "t_struct(ConversionConfig)12709_storage": { + "encoding": "inplace", + "label": "struct IAbstractTokenConverter.ConversionConfig", + "members": [ + { + "astId": 12704, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "incentive", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 12708, + "contract": "contracts/TokenConverter/SingleTokenConverter.sol:SingleTokenConverter", + "label": "conversionAccess", + "offset": 0, + "slot": "1", + "type": "t_enum(ConversionAccessibility)12700" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/arbitrumone/USDCPrimeConverter.json b/deployments/arbitrumone/USDCPrimeConverter.json new file mode 100644 index 00000000..145ee97c --- /dev/null +++ b/deployments/arbitrumone/USDCPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "transactionIndex": 5, + "gasUsed": "1253152", + "logsBloom": "0x000000000008000000000000000000048000000004000000008000000000000000040000000000001000000010000000000000000000000000000010000080000000000000400000000000000010000000010040000000000080000000000000000000000200000000000404040008000000000000000000000000100000004000000000000200000000000000000800000000000000800000000000000000000000000000000000000000040004000800000000088008000000000004000000008000000000000000000000000400000200000000000000008000002000200000000000000000000000000000100000000008c0002000000000000000000000", + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee", + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000993900ab4ef4092e5b76d4781d09a2732086f0f0" + ], + "data": "0x", + "logIndex": 8, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831" + ], + "data": "0x", + "logIndex": 9, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 10, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 11, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d96007" + ], + "data": "0x", + "logIndex": 12, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000086bf21db200f29f21253080942be8af61046ec29" + ], + "data": "0x", + "logIndex": 13, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 14, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + }, + { + "transactionIndex": 5, + "blockNumber": 276069030, + "transactionHash": "0x74606e6a6fda31044494bf83d9d004e43c53a9b56501fbf2a0c0c1b56c4125a2", + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 15, + "blockHash": "0xefcbd69d4de083920297b08c8009c9acff33c0d818f4acca586a11539f2dc9ee" + } + ], + "blockNumber": 276069030, + "cumulativeGasUsed": "2293049", + "status": 1, + "byzantium": true + }, + "args": [ + "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "0xf7013ef6000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d9600700000000000000000000000086bf21db200f29f21253080942be8af61046ec29000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/USDTPrimeConverter.json b/deployments/arbitrumone/USDTPrimeConverter.json new file mode 100644 index 00000000..4ecae5cd --- /dev/null +++ b/deployments/arbitrumone/USDTPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "transactionIndex": 8, + "gasUsed": "1250790", + "logsBloom": "0x0000000000080000000000000000000480000000000000000080000000000000000400000000000000000000100000000000002000000000000000100000800000000000000000000000000000100000000100400000000000c000000000000000000000020000000000040404000800000000000000000000000010000000400000000000020000000000000000080000000000000080000000000000000000000000000000000000000004000400080000000008800800000000000000000000800000000000040000000000040000020000000000200000800000200020000000000000000000000000000030000000000880000000000000080000000000", + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b", + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000993900ab4ef4092e5b76d4781d09a2732086f0f0" + ], + "data": "0x", + "logIndex": 17, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9" + ], + "data": "0x", + "logIndex": 18, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 19, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 20, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d96007" + ], + "data": "0x", + "logIndex": 21, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000086bf21db200f29f21253080942be8af61046ec29" + ], + "data": "0x", + "logIndex": 22, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 23, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + }, + { + "transactionIndex": 8, + "blockNumber": 276068991, + "transactionHash": "0x99ba48957a9cdfe26a4785cbc608b3076c07c5785688d72806fd848116fe7b1a", + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 24, + "blockHash": "0xaf31d7af149ba3d673b97fe1061713c5d5fe1905eff09ec0d4c9956871cfe69b" + } + ], + "blockNumber": 276068991, + "cumulativeGasUsed": "3951026", + "status": 1, + "byzantium": true + }, + "args": [ + "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "0xf7013ef6000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d9600700000000000000000000000086bf21db200f29f21253080942be8af61046ec29000000000000000000000000fd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb90000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/WBTCPrimeConverter.json b/deployments/arbitrumone/WBTCPrimeConverter.json new file mode 100644 index 00000000..b19016d2 --- /dev/null +++ b/deployments/arbitrumone/WBTCPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0xF91369009c37f029aa28AF89709a352375E5A162", + "transactionIndex": 4, + "gasUsed": "1250790", + "logsBloom": "0x00008000000800000000000000000004800000000100000000800000000000000004000000000001000000001000000000000000000000000000001000008000000000000000000000000000001000000001004000000000008008000000000000000000020000000000040404000800000000000000000000000010000000400000000000020000000000000000880000000000000080000000000000000000000000000000000000000004000400080000000008800800000000000000000000800000000000000000000000040000020000000000000000800000200020200000000000000000000000000010000000000880000000000000000000000000", + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01", + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "logs": [ + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000993900ab4ef4092e5b76d4781d09a2732086f0f0" + ], + "data": "0x", + "logIndex": 10, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f" + ], + "data": "0x", + "logIndex": 11, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 12, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 13, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d96007" + ], + "data": "0x", + "logIndex": 14, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000086bf21db200f29f21253080942be8af61046ec29" + ], + "data": "0x", + "logIndex": 15, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 16, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + }, + { + "transactionIndex": 4, + "blockNumber": 276069066, + "transactionHash": "0x454568e36bd9b712fc8b3ab31de3c612fc0223cf66e33453e6cab3457696f2ab", + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 17, + "blockHash": "0x3161b77a7d67efdf838be45d95acbf42b086c7156c5151d36a38bec4db607f01" + } + ], + "blockNumber": 276069066, + "cumulativeGasUsed": "2181002", + "status": 1, + "byzantium": true + }, + "args": [ + "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "0xf7013ef6000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d9600700000000000000000000000086bf21db200f29f21253080942be8af61046ec290000000000000000000000002f2a2543b76a4166549f7aab2e75bef0aefc5b0f0000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/WETHPrimeConverter.json b/deployments/arbitrumone/WETHPrimeConverter.json new file mode 100644 index 00000000..9890b9dd --- /dev/null +++ b/deployments/arbitrumone/WETHPrimeConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "transactionIndex": 3, + "gasUsed": "1250200", + "logsBloom": "0x00000000000800000400000000000004800000000000000000800000000000000004000000000000000000001000000000000000000000000000001000008000000000000000000000000000001000010001004000000000008000800000000000000000020000000000040404000800000000000000000000000010000000400000000000020000000000000000080000000000000080000000000000000000000000010000000000000004000400080000000008800800000000000000000000800000000000000000000000040000020000000000000000800000200020000000000000000000020000000010000000000880000000800000000000000000", + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96", + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "logs": [ + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000993900ab4ef4092e5b76d4781d09a2732086f0f0" + ], + "data": "0x", + "logIndex": 2, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1" + ], + "data": "0x", + "logIndex": 3, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 4, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 5, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d96007" + ], + "data": "0x", + "logIndex": 6, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000086bf21db200f29f21253080942be8af61046ec29" + ], + "data": "0x", + "logIndex": 7, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 8, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + }, + { + "transactionIndex": 3, + "blockNumber": 276069104, + "transactionHash": "0xf22c750decee8c7887035b4a7a7494d92a51186848bcfbae6d8973f2455c5547", + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 9, + "blockHash": "0x7d168e177bea1e0967e90c2c24498329441d575989fa0a92996f7a409708bd96" + } + ], + "blockNumber": 276069104, + "cumulativeGasUsed": "1571503", + "status": 1, + "byzantium": true + }, + "args": [ + "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "0xf7013ef6000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d9600700000000000000000000000086bf21db200f29f21253080942be8af61046ec2900000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/XVSVaultConverter.json b/deployments/arbitrumone/XVSVaultConverter.json new file mode 100644 index 00000000..3c391794 --- /dev/null +++ b/deployments/arbitrumone/XVSVaultConverter.json @@ -0,0 +1,229 @@ +{ + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "transactionIndex": 5, + "gasUsed": "1251381", + "logsBloom": "0x00000000000800000000000000000004800000000000000000800000000000000004001000040000000000001000000000000000000000000000001000008000000000000000000000000000001000000001004000000000008002000000000000000000020000000000040004000800000000000000000000000010000000400000000000020000000000000000280000000000000080000000000000000000000000000000000000100004000400080000000000800800000000000200000000800000000000000000000000040000020000000002080000802000200020000000000000000000000000000000000000000880000000000000000000000000", + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e", + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "logs": [ + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": [ + "0x1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e", + "0x000000000000000000000000993900ab4ef4092e5b76d4781d09a2732086f0f0" + ], + "data": "0x", + "logIndex": 8, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": [ + "0x4fe44995ca2482562846e3c0413d9bd6147e9ce1881c66a8765e8542fef99f42", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000c1eb7689147c81ac840d4ff0d298489fc7986d52" + ], + "data": "0x", + "logIndex": 9, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 10, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 11, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": [ + "0x56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d96007" + ], + "data": "0x", + "logIndex": 12, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": [ + "0x9be3097b5c8b276786be52a244ee90d66efd34805d9eb16f168fb2b4aaae9a2b", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000b076d4f15c08d7a7b89466327ba71bc7e1311b58" + ], + "data": "0x", + "logIndex": 13, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": ["0xada67d0d38fa20c8ae6a5c17cb9d60b0fe7f2d4e4f27ac9ee55e54ac88de9d8d"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e80000", + "logIndex": 14, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + }, + { + "transactionIndex": 5, + "blockNumber": 276069138, + "transactionHash": "0xbb7a9375e603914f4d1c9efd17e7078263d6e52347d16d3ea92087fae4300d45", + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 15, + "blockHash": "0xde3fcae5b25a4d62e913b0e25a0d095c7136e12f451fee1905a5c5f35376fa9e" + } + ], + "blockNumber": 276069138, + "cumulativeGasUsed": "2746507", + "status": 1, + "byzantium": true + }, + "args": [ + "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "0xf7013ef6000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157000000000000000000000000d55a98150e0f9f5e3f6280fc25617a5c93d96007000000000000000000000000b076d4f15c08d7a7b89466327ba71bc7e1311b58000000000000000000000000c1eb7689147c81ac840d4ff0d298489fc7986d520000000000000000000000000000000000000000000000008ac7230489e80000" + ], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._\",\"events\":{\"AdminChanged(address,address)\":{\"details\":\"Emitted when the admin account has changed.\"},\"BeaconUpgraded(address)\":{\"details\":\"Emitted when the beacon is changed.\"},\"Upgraded(address)\":{\"details\":\"Emitted when the implementation is upgraded.\"}},\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":\"BeaconProxy\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/IERC1967.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\\n *\\n * _Available since v4.8.3._\\n */\\ninterface IERC1967 {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Emitted when the beacon is changed.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n}\\n\",\"keccak256\":\"0x3cbef5ebc24b415252e2f8c0c9254555d30d9f085603b4b80d9b5ed20ab87e90\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/IERC1967.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n */\\nabstract contract ERC1967Upgrade is IERC1967 {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3b21ae06bf5957f73fa16754b0669c77b7abd8ba6c072d35c3281d446fdb86c2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\\n * _Available since v4.9 for `string`, `bytes`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf09e68aa0dc6722a25bc46490e8d48ed864466d17313b8a0b254c36b54e49899\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526040516106f33803806106f383398101604081905261002291610420565b61002e82826000610035565b505061054a565b61003e836100f6565b6040516001600160a01b038416907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a260008251118061007f5750805b156100f1576100ef836001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e991906104e0565b8361027a565b505b505050565b6001600160a01b0381163b6101605760405162461bcd60e51b815260206004820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b60648201526084015b60405180910390fd5b6101d4816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101c591906104e0565b6001600160a01b03163b151590565b6102395760405162461bcd60e51b815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608401610157565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392909216919091179055565b606061029f83836040518060600160405280602781526020016106cc602791396102a6565b9392505050565b6060600080856001600160a01b0316856040516102c391906104fb565b600060405180830381855af49150503d80600081146102fe576040519150601f19603f3d011682016040523d82523d6000602084013e610303565b606091505b5090925090506103158683838761031f565b9695505050505050565b6060831561038e578251600003610387576001600160a01b0385163b6103875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610157565b5081610398565b61039883836103a0565b949350505050565b8151156103b05781518083602001fd5b8060405162461bcd60e51b81526004016101579190610517565b80516001600160a01b03811681146103e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104175781810151838201526020016103ff565b50506000910152565b6000806040838503121561043357600080fd5b61043c836103ca565b60208401519092506001600160401b038082111561045957600080fd5b818501915085601f83011261046d57600080fd5b81518181111561047f5761047f6103e6565b604051601f8201601f19908116603f011681019083821181831017156104a7576104a76103e6565b816040528281528860208487010111156104c057600080fd5b6104d18360208301602088016103fc565b80955050505050509250929050565b6000602082840312156104f257600080fd5b61029f826103ca565b6000825161050d8184602087016103fc565b9190910192915050565b60208152600082518060208401526105368160408501602087016103fc565b601f01601f19169190910160400192915050565b610173806105596000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040523661001357610011610017565b005b6100115b610027610022610029565b6100dc565b565b60006100697fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d79190610100565b905090565b3660008037600080366000845af43d6000803e8080156100fb573d6000f35b3d6000fd5b60006020828403121561011257600080fd5b815173ffffffffffffffffffffffffffffffffffffffff8116811461013657600080fd5b939250505056fea264697066735822122019aa0de4232b32197b09094d35b769e2341305b486d5731b222ea93eca90407364736f6c63430008190033", + "devdoc": { + "details": "This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}. The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't conflict with the storage layout of the implementation behind the proxy. _Available since v3.4._", + "events": { + "AdminChanged(address,address)": { + "details": "Emitted when the admin account has changed." + }, + "BeaconUpgraded(address)": { + "details": "Emitted when the beacon is changed." + }, + "Upgraded(address)": { + "details": "Emitted when the implementation is upgraded." + } + }, + "kind": "dev", + "methods": { + "constructor": { + "details": "Initializes the proxy with `beacon`. If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity constructor. Requirements: - `beacon` must be a contract with the interface {IBeacon}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/solcInputs/027aeec938943227f90cf24126ba2c44.json b/deployments/arbitrumone/solcInputs/027aeec938943227f90cf24126ba2c44.json new file mode 100644 index 00000000..0a7015ab --- /dev/null +++ b/deployments/arbitrumone/solcInputs/027aeec938943227f90cf24126ba2c44.json @@ -0,0 +1,280 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\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" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\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 cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1967.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/IERC1967.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(ITransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(ITransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n ITransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(address) external;\n\n function upgradeTo(address) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) {\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n revert(\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return \"\";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() private {\n require(msg.value == 0);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@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" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^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 // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\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(uint256 x, uint256 y, uint256 denominator, Rounding rounding) 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 // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `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 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.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 `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n 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 /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface VBep20Interface is IERC20Metadata {\n /**\n * @notice Underlying asset for this VToken\n */\n function underlying() external view returns (address);\n}\n" + }, + "@venusprotocol/oracle/contracts/ResilientOracle.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\n// SPDX-FileCopyrightText: 2022 Venus\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"./interfaces/VBep20Interface.sol\";\nimport \"./interfaces/OracleInterface.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\n\n/**\n * @title ResilientOracle\n * @author Venus\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\n * \n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\n * for attacking the protocol.\n * \n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\n * \n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \n * \n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\n * market. The upper bound ratio represents the deviation between reported price (the price that’s being\n * validated) and the anchor price (the price we are validating against) above which the reported price will\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\n * should be true:\n\n```\nanchorRatio = anchorPrice/reporterPrice\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\n```\n\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \n * \n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\n * oracle to be stagnant and treat it like it's disabled.\n */\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\n /**\n * @dev Oracle roles:\n * **main**: The most trustworthy price source\n * **pivot**: Price oracle used as a loose sanity checker\n * **fallback**: The backup source when main oracle price is invalidated\n */\n enum OracleRole {\n MAIN,\n PIVOT,\n FALLBACK\n }\n\n struct TokenConfig {\n /// @notice asset address\n address asset;\n /// @notice `oracles` stores the oracles based on their role in the following order:\n /// [main, pivot, fallback],\n /// It can be indexed with the corresponding enum OracleRole value\n address[3] oracles;\n /// @notice `enableFlagsForOracles` stores the enabled state\n /// for each oracle in the same order as `oracles`\n bool[3] enableFlagsForOracles;\n }\n\n uint256 public constant INVALID_PRICE = 0;\n\n /// @notice Native market address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable nativeMarket;\n\n /// @notice VAI address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vai;\n\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\n /// and can serve as any underlying asset of a market that supports native tokens\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\n\n /// @notice Bound validator contract address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n BoundValidatorInterface public immutable boundValidator;\n\n mapping(address => TokenConfig) private tokenConfigs;\n\n event TokenConfigAdded(\n address indexed asset,\n address indexed mainOracle,\n address indexed pivotOracle,\n address fallbackOracle\n );\n\n /// Event emitted when an oracle is set\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\n\n /// Event emitted when an oracle is enabled or disabled\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\n\n /**\n * @notice Checks whether an address is null or not\n */\n modifier notNullAddress(address someone) {\n if (someone == address(0)) revert(\"can't be zero address\");\n _;\n }\n\n /**\n * @notice Checks whether token config exists by checking whether asset is null address\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\n * @param asset asset address\n */\n modifier checkTokenConfigExistence(address asset) {\n if (tokenConfigs[asset].asset == address(0)) revert(\"token config must exist\");\n _;\n }\n\n /// @notice Constructor for the implementation contract. Sets immutable variables.\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\n /// (e.g vETH on ethereum would not be supported, only vWETH)\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\n /// Set to address(0) of VAI is not existent.\n /// @param _boundValidator Address of the bound validator contract\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address nativeMarketAddress,\n address vaiAddress,\n BoundValidatorInterface _boundValidator\n ) notNullAddress(address(_boundValidator)) {\n nativeMarket = nativeMarketAddress;\n vai = vaiAddress;\n boundValidator = _boundValidator;\n\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract admin and sets the BoundValidator contract address\n * @param accessControlManager_ Address of the access control manager contract\n */\n function initialize(address accessControlManager_) external initializer {\n __AccessControlled_init(accessControlManager_);\n __Pausable_init();\n }\n\n /**\n * @notice Pauses oracle\n * @custom:access Only Governance\n */\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n _pause();\n }\n\n /**\n * @notice Unpauses oracle\n * @custom:access Only Governance\n */\n function unpause() external {\n _checkAccessAllowed(\"unpause()\");\n _unpause();\n }\n\n /**\n * @notice Batch sets token configs\n * @param tokenConfigs_ Token config array\n * @custom:access Only Governance\n * @custom:error Throws a length error if the length of the token configs array is 0\n */\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\n if (tokenConfigs_.length == 0) revert(\"length can't be 0\");\n uint256 numTokenConfigs = tokenConfigs_.length;\n for (uint256 i; i < numTokenConfigs; ) {\n setTokenConfig(tokenConfigs_[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @notice Sets oracle for a given asset and role.\n * @dev Supplied asset **must** exist and main oracle may not be null\n * @param asset Asset address\n * @param oracle Oracle address\n * @param role Oracle role\n * @custom:access Only Governance\n * @custom:error Null address error if main-role oracle address is null\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\n */\n function setOracle(\n address asset,\n address oracle,\n OracleRole role\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"setOracle(address,address,uint8)\");\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\"can't set zero address to main oracle\");\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\n emit OracleSet(asset, oracle, uint256(role));\n }\n\n /**\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\n * @param asset Asset address\n * @param role Oracle role\n * @param enable Enabled boolean of the oracle\n * @custom:access Only Governance\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n */\n function enableOracle(\n address asset,\n OracleRole role,\n bool enable\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"enableOracle(address,uint8,bool)\");\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\n emit OracleEnabled(asset, uint256(role), enable);\n }\n\n /**\n * @notice Updates the TWAP pivot oracle price.\n * @dev This function should always be called before calling getUnderlyingPrice\n * @param vToken vToken address\n */\n function updatePrice(address vToken) external override {\n address asset = _getUnderlyingAsset(vToken);\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @notice Updates the pivot oracle price. Currently using TWAP\n * @dev This function should always be called before calling getPrice\n * @param asset asset address\n */\n function updateAssetPrice(address asset) external {\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @dev Gets token config by asset address\n * @param asset asset address\n * @return tokenConfig Config for the asset\n */\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\n return tokenConfigs[asset];\n }\n\n /**\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\n * - Check if the oracle is paused globally\n * - Validate price from main oracle against pivot oracle\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\n * - Validate price from main oracle against fallback oracle if the second validation failed\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\n * main oracle price is returned.\n * @param vToken vToken address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n\n address asset = _getUnderlyingAsset(vToken);\n return _getPrice(asset);\n }\n\n /**\n * @notice Gets price of the asset\n * @param asset asset address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getPrice(address asset) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n return _getPrice(asset);\n }\n\n /**\n * @notice Sets/resets single token configs.\n * @dev main oracle **must not** be a null address\n * @param tokenConfig Token config struct\n * @custom:access Only Governance\n * @custom:error NotNullAddress is thrown if asset address is null\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\n */\n function setTokenConfig(\n TokenConfig memory tokenConfig\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\n _checkAccessAllowed(\"setTokenConfig(TokenConfig)\");\n\n tokenConfigs[tokenConfig.asset] = tokenConfig;\n emit TokenConfigAdded(\n tokenConfig.asset,\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\n );\n }\n\n /**\n * @notice Gets oracle and enabled status by asset address\n * @param asset asset address\n * @param role Oracle role\n * @return oracle Oracle address based on role\n * @return enabled Enabled flag of the oracle based on token config\n */\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\n oracle = tokenConfigs[asset].oracles[uint256(role)];\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\n }\n\n function _getPrice(address asset) internal view returns (uint256) {\n uint256 pivotPrice = INVALID_PRICE;\n\n // Get pivot oracle price, Invalid price if not available or error\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracleEnabled && pivotOracle != address(0)) {\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\n pivotPrice = pricePivot;\n } catch {}\n }\n\n // Compare main price and pivot price, return main price and if validation was successful\n // note: In case pivot oracle is not available but main price is available and\n // validation is successful, the main oracle price is returned.\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\n asset,\n pivotPrice,\n pivotOracleEnabled && pivotOracle != address(0)\n );\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\n\n // Compare fallback and pivot if main oracle comparision fails with pivot\n // Return fallback price when fallback price is validated successfully with pivot oracle\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\n\n // Lastly compare main price and fallback price\n if (\n mainPrice != INVALID_PRICE &&\n fallbackPrice != INVALID_PRICE &&\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\n ) {\n return mainPrice;\n }\n\n revert(\"invalid resilient oracle price\");\n }\n\n /**\n * @notice Gets a price for the provided asset\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\n * able to fetch a correct price\n * @param asset asset address\n * @param pivotPrice Pivot oracle price\n * @param pivotEnabled If pivot oracle is not empty and enabled\n * @return price USD price in scaled decimals\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\n * @return pivotValidated Boolean representing if the validation of main oracle price\n * and pivot oracle price were successful\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\n * address is null\n */\n function _getMainOraclePrice(\n address asset,\n uint256 pivotPrice,\n bool pivotEnabled\n ) internal view returns (uint256, bool) {\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\n if (mainOracleEnabled && mainOracle != address(0)) {\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\n if (!pivotEnabled) {\n return (mainOraclePrice, true);\n }\n if (pivotPrice == INVALID_PRICE) {\n return (mainOraclePrice, false);\n }\n return (\n mainOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\n * @param asset asset address\n * @return price USD price in 18 decimals\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\n * and pivot oracle price were successfull\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\n * address is null\n */\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\n if (fallbackEnabled && fallbackOracle != address(0)) {\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\n if (pivotPrice == INVALID_PRICE) {\n return (fallbackOraclePrice, false);\n }\n return (\n fallbackOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function returns the underlying asset of a vToken\n * @param vToken vToken address\n * @return asset underlying asset address\n */\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\n if (vToken == nativeMarket) {\n asset = NATIVE_TOKEN_ADDR;\n } else if (vToken == vai) {\n asset = vai;\n } else {\n asset = VBep20Interface(vToken).underlying();\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/constants.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\nuint256 constant EXP_SCALE = 1e18;\n\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\nuint256 constant MANTISSA_ONE = EXP_SCALE;\n\n/// @dev The approximate number of seconds per year\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\n" + }, + "@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/**\n * @title MaxLoopsLimitHelper\n * @author Venus\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\n */\nabstract contract MaxLoopsLimitHelper {\n // Limit for the loops to avoid the DOS\n uint256 public maxLoopsLimit;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when max loops limit is set\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\n\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n */\n function _setMaxLoopsLimit(uint256 limit) internal {\n require(limit > maxLoopsLimit, \"Comptroller: Invalid maxLoopsLimit\");\n\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\n maxLoopsLimit = limit;\n\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\n }\n\n /**\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\n * @param len Length of the loops iterate\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\n */\n function _ensureMaxLoops(uint256 len) internal view {\n if (len > maxLoopsLimit) {\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/validators.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\nerror ZeroAddressNotAllowed();\n\n/// @notice Thrown if the supplied value is 0 where it is not allowed\nerror ZeroValueNotAllowed();\n\n/// @notice Checks if the provided address is nonzero, reverts otherwise\n/// @param address_ Address to check\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\nfunction ensureNonzeroAddress(address address_) pure {\n if (address_ == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n}\n\n/// @notice Checks if the provided value is nonzero, reverts otherwise\n/// @param value_ Value to check\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\nfunction ensureNonzeroValue(uint256 value_) pure {\n if (value_ == 0) {\n revert ZeroValueNotAllowed();\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport 'hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol';\n" + }, + "contracts/hardhat-dependency-compiler/hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport 'hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol';\n" + }, + "contracts/Interfaces/IComptroller.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IComptroller {\n function isComptroller() external view returns (bool);\n\n function markets(address) external view returns (bool);\n\n function getAllMarkets() external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { IAbstractTokenConverter } from \"../TokenConverter/IAbstractTokenConverter.sol\";\n\n/**\n * @title IConverterNetwork\n * @author Venus\n * @notice Interface implemented by `ConverterNetwork`.\n */\ninterface IConverterNetwork {\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\n\n /// @notice This function checks for given address is converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return boolean true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool);\n}\n" + }, + "contracts/Interfaces/IIncomeDestination.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IIncomeDestination {\n function updateAssetsState(address comptroller, address asset) external;\n}\n" + }, + "contracts/Interfaces/IPoolRegistry.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IPoolRegistry {\n /// @notice Get VToken in the Pool for an Asset\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\n\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IProtocolShareReserve {\n /// @notice it represents the type of vToken income\n enum IncomeType {\n SPREAD,\n LIQUIDATION\n }\n\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) external;\n}\n" + }, + "contracts/Interfaces/IRiskFund.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IRiskFund\n * @author Venus\n * @notice Interface implemented by `RiskFund`.\n */\ninterface IRiskFund {\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\n\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) external;\n\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\n}\n\n/**\n * @title IRiskFundGetters\n * @author Venus\n * @notice Interface implemented by `RiskFund` for getter methods.\n */\ninterface IRiskFundGetters {\n function convertibleBaseAsset() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IRiskFundConverter {\n function updateAssetsState(address comptroller, address asset) external;\n\n function getPools(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IShortfall.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IShortfall\n * @author Venus\n * @notice Interface implemented by `Shortfall`.\n */\ninterface IShortfall {\n function convertibleBaseAsset() external returns (address);\n}\n" + }, + "contracts/Interfaces/IVToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IVToken {\n function underlying() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IXVSVault.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @title IXVSVaultProxy\n/// @author Venus\n/// @notice Interface implemented by `XVSVault`.\ninterface IXVSVault {\n function xvsStore() external view returns (address);\n}\n" + }, + "contracts/ProtocolReserve/ProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable, IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IProtocolShareReserve } from \"../Interfaces/IProtocolShareReserve.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\nimport { IIncomeDestination } from \"../Interfaces/IIncomeDestination.sol\";\n\nerror InvalidAddress();\nerror UnsupportedAsset();\nerror InvalidTotalPercentage();\nerror InvalidMaxLoopsLimit();\n\ncontract ProtocolShareReserve is\n AccessControlledV8,\n ReentrancyGuardUpgradeable,\n MaxLoopsLimitHelper,\n IProtocolShareReserve\n{\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice protocol income is categorized into two schemas.\n /// The first schema is for spread income\n /// The second schema is for liquidation income\n enum Schema {\n PROTOCOL_RESERVES,\n ADDITIONAL_REVENUE\n }\n\n struct DistributionConfig {\n Schema schema;\n /// @dev percenatge is represented without any scale\n uint16 percentage;\n address destination;\n }\n\n /// @notice address of core pool comptroller contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n /// @notice address of WBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable WBNB;\n\n /// @notice address of vBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vBNB;\n\n /// @notice address of pool registry contract\n address public poolRegistry;\n\n uint16 public constant MAX_PERCENT = 1e4;\n\n /// @notice comptroller => asset => schema => balance\n mapping(address => mapping(address => mapping(Schema => uint256))) public assetsReserves;\n\n /// @notice asset => balance\n mapping(address => uint256) public totalAssetReserve;\n\n /// @notice configuration for different income distribution targets\n DistributionConfig[] public distributionTargets;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Event emitted after updating of the assets reserves.\n event AssetsReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n uint256 amount,\n IncomeType incomeType,\n Schema schema\n );\n\n /// @notice Event emitted when an asset is released to a target\n event AssetReleased(\n address indexed destination,\n address indexed asset,\n Schema schema,\n uint256 percent,\n uint256 amount\n );\n\n /// @notice Event emitted when asset reserves state is updated\n event ReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n Schema schema,\n uint256 oldBalance,\n uint256 newBalance\n );\n\n /// @notice Event emitted when distribution configuration is updated\n event DistributionConfigUpdated(\n address indexed destination,\n uint16 oldPercentage,\n uint16 newPercentage,\n Schema schema\n );\n\n /// @notice Event emitted when distribution configuration is added\n event DistributionConfigAdded(address indexed destination, uint16 percentage, Schema schema);\n\n /// @notice Event emitted when distribution configuration is removed\n event DistributionConfigRemoved(address indexed destination, uint16 percentage, Schema schema);\n\n /**\n * @dev Constructor to initialize the immutable variables\n * @param _corePoolComptroller The address of core pool comptroller\n * @param _wbnb The address of WBNB\n * @param _vbnb The address of vBNB\n */\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address _corePoolComptroller,\n address _wbnb,\n address _vbnb\n ) {\n ensureNonzeroAddress(_corePoolComptroller);\n ensureNonzeroAddress(_wbnb);\n ensureNonzeroAddress(_vbnb);\n\n CORE_POOL_COMPTROLLER = _corePoolComptroller;\n WBNB = _wbnb;\n vBNB = _vbnb;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /**\n * @dev Initializes the deployer to owner.\n * @param _accessControlManager The address of ACM contract\n * @param _loopsLimit Limit for the loops in the contract to avoid DOS\n */\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n __AccessControlled_init(_accessControlManager);\n __ReentrancyGuard_init();\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @dev Pool registry setter.\n * @param _poolRegistry Address of the pool registry\n * @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n */\n function setPoolRegistry(address _poolRegistry) external onlyOwner {\n ensureNonzeroAddress(_poolRegistry);\n emit PoolRegistryUpdated(poolRegistry, _poolRegistry);\n poolRegistry = _poolRegistry;\n }\n\n /**\n * @dev Add or update destination targets based on destination address\n * @param configs configurations of the destinations.\n */\n function addOrUpdateDistributionConfigs(DistributionConfig[] calldata configs) external nonReentrant {\n _checkAccessAllowed(\"addOrUpdateDistributionConfigs(DistributionConfig[])\");\n\n for (uint256 i = 0; i < configs.length; ) {\n DistributionConfig memory _config = configs[i];\n ensureNonzeroAddress(_config.destination);\n\n bool updated = false;\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 j = 0; j < distributionTargetsLength; ) {\n DistributionConfig storage config = distributionTargets[j];\n\n if (_config.schema == config.schema && config.destination == _config.destination) {\n emit DistributionConfigUpdated(\n _config.destination,\n config.percentage,\n _config.percentage,\n _config.schema\n );\n config.percentage = _config.percentage;\n updated = true;\n break;\n }\n\n unchecked {\n ++j;\n }\n }\n\n if (!updated) {\n distributionTargets.push(_config);\n emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);\n }\n\n unchecked {\n ++i;\n }\n }\n\n _ensurePercentages();\n _ensureMaxLoops(distributionTargets.length);\n }\n\n /**\n * @dev Remove destionation target if percentage is 0\n * @param schema schema of the configuration\n * @param destination destination address of the configuration\n */\n function removeDistributionConfig(Schema schema, address destination) external {\n _checkAccessAllowed(\"removeDistributionConfig(Schema,address)\");\n\n uint256 distributionIndex;\n bool found = false;\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig storage config = distributionTargets[i];\n\n if (schema == config.schema && destination == config.destination && config.percentage == 0) {\n found = true;\n distributionIndex = i;\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n\n if (found) {\n emit DistributionConfigRemoved(\n distributionTargets[distributionIndex].destination,\n distributionTargets[distributionIndex].percentage,\n distributionTargets[distributionIndex].schema\n );\n\n distributionTargets[distributionIndex] = distributionTargets[distributionTargets.length - 1];\n distributionTargets.pop();\n }\n\n _ensurePercentages();\n }\n\n /**\n * @dev Release funds\n * @param comptroller the comptroller address of the pool\n * @param assets assets to be released to distribution targets\n */\n function releaseFunds(address comptroller, address[] calldata assets) external nonReentrant {\n for (uint256 i = 0; i < assets.length; ) {\n _releaseFund(comptroller, assets[i]);\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Used to find out the amount of funds that's going to be released when release funds is called.\n * @param comptroller the comptroller address of the pool\n * @param schema the schema of the distribution target\n * @param destination the destination address of the distribution target\n * @param asset the asset address which will be released\n */\n function getUnreleasedFunds(\n address comptroller,\n Schema schema,\n address destination,\n address asset\n ) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig storage _config = distributionTargets[i];\n if (_config.schema == schema && _config.destination == destination) {\n uint256 total = assetsReserves[comptroller][asset][schema];\n return (total * _config.percentage) / MAX_PERCENT;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Returns the total number of distribution targets\n */\n function totalDistributions() external view returns (uint256) {\n return distributionTargets.length;\n }\n\n /**\n * @dev Used to find out the percentage distribution for a particular destination based on schema\n * @param destination the destination address of the distribution target\n * @param schema the schema of the distribution target\n * @return percentage percentage distribution\n */\n function getPercentageDistribution(address destination, Schema schema) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n\n if (config.destination == destination && config.schema == schema) {\n return config.percentage;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\n * @param comptroller Comptroller address (pool)\n * @param asset Asset address.\n * @param incomeType type of income\n */\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) public override(IProtocolShareReserve) nonReentrant {\n if (!IComptroller(comptroller).isComptroller()) revert InvalidAddress();\n ensureNonzeroAddress(asset);\n\n if (\n comptroller != CORE_POOL_COMPTROLLER &&\n IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) == address(0)\n ) revert InvalidAddress();\n\n Schema schema = _getSchema(incomeType);\n uint256 currentBalance = IERC20Upgradeable(asset).balanceOf(address(this));\n uint256 assetReserve = totalAssetReserve[asset];\n\n if (currentBalance > assetReserve) {\n uint256 balanceDifference;\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n\n assetsReserves[comptroller][asset][schema] += balanceDifference;\n totalAssetReserve[asset] += balanceDifference;\n emit AssetsReservesUpdated(comptroller, asset, balanceDifference, incomeType, schema);\n }\n }\n\n /**\n * @dev asset from a particular pool to be release to distribution targets\n * @param comptroller Comptroller address(pool)\n * @param asset Asset address.\n */\n function _releaseFund(address comptroller, address asset) internal {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint256[] memory schemaBalances = new uint256[](totalSchemas);\n uint256 totalBalance;\n for (uint256 schemaValue; schemaValue < totalSchemas; ) {\n schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];\n totalBalance += schemaBalances[schemaValue];\n\n unchecked {\n ++schemaValue;\n }\n }\n\n if (totalBalance == 0) {\n return;\n }\n\n uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig memory _config = distributionTargets[i];\n\n uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;\n totalTransferAmounts[uint256(_config.schema)] += transferAmount;\n\n if (transferAmount != 0) {\n IERC20Upgradeable(asset).safeTransfer(_config.destination, transferAmount);\n IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);\n\n emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);\n }\n\n unchecked {\n ++i;\n }\n }\n\n uint256[] memory newSchemaBalances = new uint256[](totalSchemas);\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];\n assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];\n totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];\n\n emit ReservesUpdated(\n comptroller,\n asset,\n Schema(schemaValue),\n schemaBalances[schemaValue],\n newSchemaBalances[schemaValue]\n );\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the schema based on income type\n * @param incomeType type of income\n * @return schema schema for distribution\n */\n function _getSchema(IncomeType incomeType) internal view returns (Schema schema) {\n schema = Schema.ADDITIONAL_REVENUE;\n\n if (incomeType == IncomeType.SPREAD) {\n schema = Schema.PROTOCOL_RESERVES;\n }\n }\n\n /**\n * @dev This ensures that the total percentage of all the distribution targets is 100% or 0%\n */\n function _ensurePercentages() internal view {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint16[] memory totalPercentages = new uint16[](totalSchemas);\n\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n totalPercentages[uint256(config.schema)] += config.percentage;\n\n unchecked {\n ++i;\n }\n }\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)\n revert InvalidTotalPercentage();\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the underlying asset address for the vToken\n * @param vToken vToken address\n * @return asset address of asset\n */\n function _getUnderlying(address vToken) internal view returns (address) {\n if (vToken == vBNB) {\n return WBNB;\n } else {\n return IVToken(vToken).underlying();\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/RiskFundStorage.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { Ownable2StepUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n/// @title ReserveHelpersStorage\n/// @author Venus\n/// @dev Reserve helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ReserveHelpersStorage is Ownable2StepUpgradeable {\n /// @notice Deprecated slot for assetReserves mapping\n bytes32 private __deprecatedSlot1;\n\n /// @notice Available asset's fund per pool in RiskFund\n /// Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolAssetsFunds;\n\n /// @notice Deprecated slot for poolRegistry address\n bytes32 private __deprecatedSlot2;\n /// @notice Deprecated slot for status variable\n bytes32 private __deprecatedSlot3;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n uint256[46] private __gap;\n}\n\n/// @title MaxLoopsLimitHelpersStorage\n/// @author Venus\n/// @dev Max loop limit helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract MaxLoopsLimitHelpersStorage {\n /// @notice Limit for the loops to avoid the DOS\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 public maxLoopsLimit;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[49] private __gap;\n}\n\n/// @title RiskFundV1Storage\n/// @author Venus\n/// @dev Risk fund V1 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV1Storage is ReserveHelpersStorage, MaxLoopsLimitHelpersStorage {\n /// @notice Address of base asset\n address public convertibleBaseAsset;\n /// @notice Address of shortfall contract\n address public shortfall;\n\n /// @notice This state is deprecated, using it to prevent storage collision\n address private pancakeSwapRouter;\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 private minAmountToConvert;\n}\n\n/// @title RiskFundV2Storage\n/// @author Venus\n/// @dev Risk fund V2 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2Storage is RiskFundV1Storage, ReentrancyGuardUpgradeable {\n /// @notice Risk fund converter address\n address public riskFundConverter;\n}\n" + }, + "contracts/ProtocolReserve/RiskFundV2.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IRiskFund } from \"../Interfaces/IRiskFund.sol\";\nimport { IRiskFundConverter } from \"../Interfaces/IRiskFundConverter.sol\";\nimport { RiskFundV2Storage } from \"./RiskFundStorage.sol\";\n\n/// @title RiskFundV2\n/// @author Venus\n/// @notice Contract with basic features to hold base asset for different Comptrollers\n/// @dev This contract does not support BNB\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2 is AccessControlledV8, RiskFundV2Storage, IRiskFund {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Emitted when convertible base asset address is updated\n event ConvertibleBaseAssetUpdated(address indexed oldConvertibleBaseAsset, address indexed newConvertibleBaseAsset);\n\n /// @notice Emitted when risk fund converter address is updated\n event RiskFundConverterUpdated(address indexed oldRiskFundConverter, address indexed newRiskFundConverter);\n\n /// @notice Emitted when shortfall contract address is updated\n event ShortfallContractUpdated(address indexed oldShortfallContract, address indexed newShortfallContract);\n\n /// @notice Emitted when reserves are transferred for auction\n event TransferredReserveForAuction(address indexed comptroller, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred to this contract\n event PoolAssetsIncreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred from this contract on sweeping tokens\n event PoolAssetsDecreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Event emitted when tokens are swept and transferred from pool\n event SweepTokenFromPool(\n address indexed token,\n address indexed comptroller,\n address indexed receiver,\n uint256 amount\n );\n\n /// @notice Error is thrown when updatePoolState is not called by riskFundConverter\n error InvalidRiskFundConverter();\n\n /// @notice Error is thrown when transferReserveForAuction is called by non shortfall address\n error InvalidShortfallAddress();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice Error is thrown when pool reserve is less than the amount needed\n error InsufficientPoolReserve(address comptroller, uint256 amount, uint256 poolReserve);\n\n /// @dev Convertible base asset setter\n /// @param convertibleBaseAsset_ Address of the convertible base asset\n /// @custom:event ConvertibleBaseAssetUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when convertible base asset address is zero\n /// @custom:access Only Governance\n function setConvertibleBaseAsset(address convertibleBaseAsset_) external onlyOwner {\n ensureNonzeroAddress(convertibleBaseAsset_);\n emit ConvertibleBaseAssetUpdated(convertibleBaseAsset, convertibleBaseAsset_);\n convertibleBaseAsset = convertibleBaseAsset_;\n }\n\n /// @dev Risk fund converter setter\n /// @param riskFundConverter_ Address of the risk fund converter\n /// @custom:event RiskFundConverterUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when risk fund converter address is zero\n /// @custom:access Only Governance\n function setRiskFundConverter(address riskFundConverter_) external onlyOwner {\n ensureNonzeroAddress(riskFundConverter_);\n emit RiskFundConverterUpdated(riskFundConverter, riskFundConverter_);\n riskFundConverter = riskFundConverter_;\n }\n\n /// @dev Shortfall contract address setter\n /// @param shortfallContractAddress_ Address of the auction contract\n /// @custom:event ShortfallContractUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when shortfall contract address is zero\n /// @custom:access Only Governance\n function setShortfallContractAddress(address shortfallContractAddress_) external onlyOwner {\n ensureNonzeroAddress(shortfallContractAddress_);\n emit ShortfallContractUpdated(shortfall, shortfallContractAddress_);\n shortfall = shortfallContractAddress_;\n }\n\n /// @dev Transfer tokens for auction to shortfall contract\n /// @param comptroller Comptroller of the pool\n /// @param amount Amount to be transferred to the shortfall\n /// @return Amount of tokens transferred to the shortfall\n /// @custom:event TransferredReserveForAuction emit on success\n /// @custom:error InvalidShortfallAddress is thrown when caller is not shortfall contract\n /// @custom:error InsufficientPoolReserve is thrown when pool reserve is less than the amount needed\n /// @custom:access Only Shortfall contract\n function transferReserveForAuction(address comptroller, uint256 amount)\n external\n override\n nonReentrant\n returns (uint256)\n {\n uint256 poolReserve = poolAssetsFunds[comptroller][convertibleBaseAsset];\n\n if (msg.sender != shortfall) {\n revert InvalidShortfallAddress();\n }\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][convertibleBaseAsset] = poolReserve - amount;\n }\n\n IERC20Upgradeable(convertibleBaseAsset).safeTransfer(shortfall, amount);\n emit TransferredReserveForAuction(comptroller, amount);\n\n return amount;\n }\n\n /// @notice Function to sweep baseAsset for pool, Tokens are sent to address(to)\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep for the pool\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice Function to sweep token from pool\n /// @param tokenAddress Address of the asset(token)\n /// @param comptroller Pool address that the assets belong to\n /// @param receiver The receiver of the funds\n /// @param amount Amount need to sweep from the pool\n /// @custom:event Emits SweepTokenFromPool event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress, comptroller, or receiver address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Controlled by AccessControlManager\n function sweepTokenFromPool(\n address tokenAddress,\n address comptroller,\n address receiver,\n uint256 amount\n ) external nonReentrant {\n _checkAccessAllowed(\"sweepTokenFromPool(address,address,address,uint256)\");\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(comptroller);\n ensureNonzeroAddress(receiver);\n ensureNonzeroValue(amount);\n\n uint256 poolReserve = poolAssetsFunds[comptroller][tokenAddress];\n\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][tokenAddress] = poolReserve - amount;\n }\n\n IERC20Upgradeable(tokenAddress).safeTransfer(receiver, amount);\n\n emit SweepTokenFromPool(tokenAddress, comptroller, receiver, amount);\n }\n\n /**\n * @notice Get the Amount of the Base asset in the risk fund for the specific pool.\n * @param comptroller Comptroller address(pool).\n * @return Base Asset's reserve in risk fund.\n */\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256) {\n return poolAssetsFunds[comptroller][convertibleBaseAsset];\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// @param comptroller Comptroller address (pool)\n /// @param asset Address of the asset(token)\n /// @param amount Amount transferred for the pool\n /// @custom:event PoolAssetsIncreased emits on success\n /// @custom:error InvalidRiskFundConverter is thrown if caller is not riskFundConverter contract\n /// @custom:access Only RiskFundConverter contract\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) public {\n if (msg.sender != riskFundConverter) {\n revert InvalidRiskFundConverter();\n }\n\n poolAssetsFunds[comptroller][asset] += amount;\n emit PoolAssetsIncreased(comptroller, asset, amount);\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n function preSweepToken(address tokenAddress, uint256 amount) internal {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n\n address[] memory pools = IRiskFundConverter(riskFundConverter).getPools(tokenAddress);\n\n uint256 assetReserves;\n uint256 poolsLength = pools.length;\n for (uint256 i; i < poolsLength; ) {\n assetReserves += poolAssetsFunds[pools[i]][tokenAddress];\n unchecked {\n ++i;\n }\n }\n\n uint256 balanceDiff = balance - assetReserves;\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n uint256 distributedShare;\n for (uint256 i; i < poolsLength; ) {\n if (poolAssetsFunds[pools[i]][tokenAddress] != 0) {\n uint256 poolAmountShare;\n if (i < (poolsLength - 1)) {\n poolAmountShare = (poolAssetsFunds[pools[i]][tokenAddress] * amount) / assetReserves;\n distributedShare += poolAmountShare;\n } else {\n poolAmountShare = amountDiff - distributedShare;\n }\n poolAssetsFunds[pools[i]][tokenAddress] -= poolAmountShare;\n emit PoolAssetsDecreased(pools[i], tokenAddress, poolAmountShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/XVSVaultTreasury.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IXVSVault } from \"../Interfaces/IXVSVault.sol\";\n\n/// @title XVSVaultTreasury\n/// @author Venus\n/// @notice XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract XVSVaultTreasury is AccessControlledV8, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice The xvs token address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable XVS_ADDRESS;\n\n /// @notice The xvsvault address\n address public xvsVault;\n\n /// @notice Emitted when XVS vault address is updated\n event XVSVaultUpdated(address indexed oldXVSVault, address indexed newXVSVault);\n\n /// @notice Emitted when funds transferred to XVSStore address\n event FundsTransferredToXVSStore(address indexed xvsStore, uint256 amountMantissa);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Thrown when given input amount is zero\n error InsufficientBalance();\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n /// @param xvsAddress_ XVS token address\n constructor(address xvsAddress_) {\n ensureNonzeroAddress(xvsAddress_);\n XVS_ADDRESS = xvsAddress_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param xvsVault_ XVSVault address\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function initialize(address accessControlManager_, address xvsVault_) public initializer {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n _setXVSVault(xvsVault_);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function setXVSVault(address xvsVault_) external onlyOwner {\n _setXVSVault(xvsVault_);\n }\n\n /// @notice This function transfers funds to the XVS vault\n /// @param amountMantissa Amount to be sent to XVS vault\n /// @custom:event FundsTransferredToXVSStore emits on success\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n /// @custom:access Restricted by ACM\n function fundXVSVault(uint256 amountMantissa) external nonReentrant {\n _checkAccessAllowed(\"fundXVSVault(uint256)\");\n ensureNonzeroValue(amountMantissa);\n\n uint256 balance = IERC20Upgradeable(XVS_ADDRESS).balanceOf(address(this));\n\n if (balance < amountMantissa) {\n revert InsufficientBalance();\n }\n\n address xvsStore = IXVSVault(xvsVault).xvsStore();\n ensureNonzeroAddress(xvsStore);\n IERC20Upgradeable(XVS_ADDRESS).safeTransfer(xvsStore, amountMantissa);\n\n emit FundsTransferredToXVSStore(xvsStore, amountMantissa);\n }\n\n /// @notice Function to sweep tokens from the contract\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep from the contract\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function _setXVSVault(address xvsVault_) internal {\n ensureNonzeroAddress(xvsVault_);\n emit XVSVaultUpdated(xvsVault, xvsVault_);\n xvsVault = xvsVault_;\n }\n}\n" + }, + "contracts/Test/imports.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n// This file is needed to make hardhat and typechain generate artifacts for\n// contracts we depend on (e.g. in tests or deployments) but not use directly.\n// Another way to do this would be to use hardhat-dependency-compiler, but\n// since we only have a couple of dependencies, installing a separate package\n// seems an overhead.\n\nimport { UpgradeableBeacon } from \"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\";\nimport { BeaconProxy } from \"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\n" + }, + "contracts/Test/Mocks/MockACM.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControl } from \"@openzeppelin/contracts/access/AccessControl.sol\";\n\ncontract MockACM is AccessControl {\n /// @notice Emitted when an account is given a permission to a certain contract function\n /// @dev If contract address is 0x000..0 this means that the account is a default admin of this function and\n /// can call any contract function with this signature\n event PermissionGranted(address account, address contractAddress, string functionSig);\n\n /// @notice Emitted when an account is revoked a permission to a certain contract function\n event PermissionRevoked(address account, address contractAddress, string functionSig);\n\n constructor() {\n // Grant the contract deployer the default admin role: it will be able\n // to grant and revoke any roles\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n }\n\n /**\n * @notice Gives a function call permission to one single account\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * @param contractAddress address of contract for which call permissions will be granted\n * @dev if contractAddress is zero address, the account can access the specified function\n * on **any** contract managed by this ACL\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @param accountToPermit account that will be given access to the contract function\n * @custom:event Emits a {RoleGranted} and {PermissionGranted} events.\n */\n function giveCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToPermit\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n grantRole(role, accountToPermit);\n emit PermissionGranted(accountToPermit, contractAddress, functionSig);\n }\n\n /**\n * @notice Revokes an account's permission to a particular function call\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * \t\tMay emit a {RoleRevoked} event.\n * @param contractAddress address of contract for which call permissions will be revoked\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @custom:event Emits {RoleRevoked} and {PermissionRevoked} events.\n */\n function revokeCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToRevoke\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n revokeRole(role, accountToRevoke);\n emit PermissionRevoked(accountToRevoke, contractAddress, functionSig);\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev Since restricted contracts using this function as a permission hook, we can get contracts address with msg.sender\n * @param account for which call permissions will be checked\n * @param functionSig restricted function signature e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n *\n */\n function isAllowedToCall(address account, string memory functionSig) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(msg.sender, functionSig));\n\n if (hasRole(role, account)) {\n return true;\n } else {\n role = keccak256(abi.encodePacked(address(0), functionSig));\n return hasRole(role, account);\n }\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev This function is used as a view function to check permissions rather than contract hook for access restriction check.\n * @param account for which call permissions will be checked against\n * @param contractAddress address of the restricted contract\n * @param functionSig signature of the restricted function e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n */\n function hasPermission(\n address account,\n address contractAddress,\n string memory functionSig\n ) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n return hasRole(role, account);\n }\n}\n" + }, + "contracts/Test/Mocks/MockArraySorter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\nimport { sort } from \"../../Utils/ArrayHelpers.sol\";\n\ncontract MockArraySorter {\n function sortArray(uint256[] memory balances, address[] memory addrs)\n external\n view\n returns (address[] memory, uint256[] memory)\n {\n sort(balances, addrs);\n return (addrs, balances);\n }\n}\n" + }, + "contracts/Test/Mocks/MockConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\n\nimport { AbstractTokenConverter } from \"../../TokenConverter/AbstractTokenConverter.sol\";\nimport { IRiskFundGetters } from \"../../Interfaces/IRiskFund.sol\";\n\ncontract MockConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) public assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolsAssetsReserves;\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n function mockPrivateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 balanceDiff\n ) external {\n _privateConversion(comptroller, tokenAddressOut, balanceDiff);\n }\n\n function AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) public initializer {\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n assetsReserves[tokenAddressIn] += convertedTokenInBalance;\n poolsAssetsReserves[comptroller][tokenAddressIn] += convertedTokenInBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @notice Get base asset address\n function _getDestinationBaseAsset() internal view override returns (address) {\n return IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/Test/Mocks/MockDeflationaryToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\ncontract MockDeflatingToken {\n string public constant NAME = \"Deflating Test Token\";\n string public constant SYMBOL = \"DTT\";\n uint8 public constant DECIMALS = 18;\n uint256 public totalSupply;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n bytes32 public immutable DOMAIN_SEPARATOR;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint256) public nonces;\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(uint256 _totalSupply) {\n uint256 chainId;\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = keccak256(\n abi.encode(\n keccak256(\"EIP712Domain(string NAME,string version,uint256 chainId,address verifyingContract)\"),\n keccak256(bytes(NAME)),\n keccak256(bytes(\"1\")),\n chainId,\n address(this)\n )\n );\n _mint(msg.sender, _totalSupply);\n }\n\n function approve(address spender, uint256 value) external returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\n }\n\n function transfer(address to, uint256 value) external returns (bool) {\n _transfer(msg.sender, to, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max) {\n allowance[from][msg.sender] = allowance[from][msg.sender] - value;\n }\n _transfer(from, to, value);\n return true;\n }\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 require(deadline >= block.timestamp, \"EXPIRED\");\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR,\n keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, \"INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n\n function _mint(address to, uint256 value) internal {\n totalSupply = totalSupply + value;\n balanceOf[to] = balanceOf[to] + value;\n emit Transfer(address(0), to, value);\n }\n\n function _burn(address from, uint256 value) internal {\n balanceOf[from] = balanceOf[from] - value;\n totalSupply = totalSupply - value;\n emit Transfer(from, address(0), value);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value\n ) private {\n allowance[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 value\n ) private {\n uint256 burnAmount = value / 100;\n _burn(from, burnAmount);\n uint256 transferAmount = value - burnAmount;\n balanceOf[from] = balanceOf[from] - transferAmount;\n balanceOf[to] = balanceOf[to] + transferAmount;\n emit Transfer(from, to, transferAmount);\n }\n}\n" + }, + "contracts/Test/Mocks/MockRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { RiskFundConverter } from \"../../TokenConverter/RiskFundConverter.sol\";\n\ncontract MockRiskFundConverter is RiskFundConverter {\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) RiskFundConverter(corePoolComptroller_, vBNB_, nativeWrapped_) {}\n\n function postConversionHookMock(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) external {\n super._postConversionHook(tokenInAddress, tokenOutAddress, amountIn, amountOut);\n }\n\n function preTransferHookMock(address tokenOutAddress, uint256 amountOut) external {\n super._preTransferHook(tokenOutAddress, amountOut);\n }\n\n function setAssetsReserves(address asset, uint256 amount) external {\n assetsReserves[asset] = amount;\n }\n\n function setPoolsAssetsReserves(\n address comptroller,\n address asset,\n uint256 amount\n ) external {\n poolsAssetsReserves[comptroller][asset] = amount;\n }\n\n function getPoolsAssetsReserves(address comptroller, address asset) external view returns (uint256) {\n return poolsAssetsReserves[comptroller][asset];\n }\n\n function getAssetsReserves(address asset) external view returns (uint256) {\n return assetsReserves[asset];\n }\n}\n" + }, + "contracts/Test/Mocks/MockToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)\n\npragma solidity 0.8.25;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract MockToken is ERC20 {\n uint8 private immutable _decimals;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_\n ) ERC20(name_, symbol_) {\n _decimals = decimals_;\n }\n\n function faucet(uint256 amount) external {\n _mint(msg.sender, amount);\n }\n\n function allocateTo(address owner, uint256 amount) external {\n _mint(owner, amount);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "contracts/TokenConverter/AbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\nimport { MANTISSA_ONE, EXP_SCALE } from \"@venusprotocol/solidity-utilities/contracts/constants.sol\";\n\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title AbstractTokenConverter\n/// @author Venus\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\n/*\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\n *\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\n * a. convertExactTokensSupportingFeeOnTransferTokens\n * b. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\n * similar to Case I.\n *\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * a. convertExactTokens\n * b. convertForExactTokens\n * c. convertExactTokensSupportingFeeOnTransferTokens\n * d. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * similar to Case III.\n *\n * ------------------------------------------------------------------------------------------------------------------------------------\n * Example 1:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInAmount - 100\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\n * function for tokenIn as deflationary token.\n *\n * Example 2:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\n * tokenOutAmount - 70\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\n * ------------------------------------------------------------------------------------------------------------------------------------\n *\n * This contract also supports private conversion between the converters:\n * Private conversions:\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\n *\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\n *\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\n * tokenAddressOut: As base asset of that converter.\n *\n * ConverterNetwork:\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\n * and tokenAddressOut provided.\n *\n * findTokenConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\n *\n * findTokenConvertersForConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\n */\n\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Maximum incentive could be\n uint256 public constant MAX_INCENTIVE = 0.5e18;\n\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\n uint256 public minAmountToConvert;\n\n /// @notice Venus price oracle contract\n ResilientOracle public priceOracle;\n\n /// @notice conversion configurations for the existing pairs\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\n\n /// @notice Address that all incoming tokens are transferred to\n address public destinationAddress;\n\n /// @notice Boolean for if conversion is paused\n bool public conversionPaused;\n\n /// @notice Address of the converterNetwork contract\n IConverterNetwork public converterNetwork;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[45] private __gap;\n\n /// @notice Emitted when config is updated for tokens pair\n event ConversionConfigUpdated(\n address indexed tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 oldIncentive,\n uint256 newIncentive,\n ConversionAccessibility oldAccess,\n ConversionAccessibility newAccess\n );\n /// @notice Emitted when price oracle address is updated\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\n\n /// @notice Emitted when destination address is updated\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\n\n /// @notice Emitted when converterNetwork address is updated\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\n\n /// @notice Emitted when exact amount of tokens are converted for tokens\n event ConvertedExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens\n event ConvertedForExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when conversion is paused\n event ConversionPaused(address indexed sender);\n\n /// @notice Emitted when conversion is unpaused\n event ConversionResumed(address indexed sender);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Emitted when minimum amount to convert is updated\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\n\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\n error AmountOutMismatched();\n\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\n error AmountInMismatched();\n\n /// @notice Thrown when given input amount is zero\n error InsufficientInputAmount();\n\n /// @notice Thrown when given output amount is zero\n error InsufficientOutputAmount();\n\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\n error ConversionConfigNotEnabled();\n\n /// @notice Thrown when conversion is enabled only for private conversions\n error ConversionEnabledOnlyForPrivateConversions();\n\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n error InvalidToAddress();\n\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\n\n /// @notice Thrown when amountOut is lower than amountOutMin\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\n\n /// @notice Thrown when amountIn is higher than amountInMax\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\n\n /// @notice Thrown when conversion is paused\n error ConversionTokensPaused();\n\n /// @notice Thrown when conversion is Active\n error ConversionTokensActive();\n\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\n error InvalidTokenConfigAddresses();\n\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\n error InsufficientPoolLiquidity();\n\n /// @notice When address of the ConverterNetwork is not set or Zero address\n error InvalidConverterNetwork();\n\n /// @notice Thrown when trying to set non zero incentive for private conversion\n error NonZeroIncentiveForPrivateConversion();\n\n /// @notice Thrown when using convertForExactTokens deflationary tokens\n error DeflationaryTokenNotSupported();\n\n /// @notice Thrown when minimum amount to convert is zero\n error InvalidMinimumAmountToConvert();\n\n /// @notice Thrown when there is a mismatch in the length of input arrays\n error InputLengthMisMatch();\n\n /**\n * @notice Modifier to ensure valid conversion parameters for a token conversion\n * and check if conversion is paused or not\n * @param to The recipient address for the converted tokens\n * @param tokenAddressIn The input token address for the conversion\n * @param tokenAddressOut The output token address for the conversion\n */\n modifier validConversionParameters(\n address to,\n address tokenAddressIn,\n address tokenAddressOut\n ) {\n _checkConversionPaused();\n ensureNonzeroAddress(to);\n if (to == tokenAddressIn || to == tokenAddressOut) {\n revert InvalidToAddress();\n }\n _;\n }\n\n /// @notice Pause conversion of tokens\n /// @custom:event Emits ConversionPaused on success\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\n /// @custom:access Restricted by ACM\n function pauseConversion() external {\n _checkAccessAllowed(\"pauseConversion()\");\n _checkConversionPaused();\n conversionPaused = true;\n emit ConversionPaused(msg.sender);\n }\n\n /// @notice Resume conversion of tokens.\n /// @custom:event Emits ConversionResumed on success\n /// @custom:error ConversionTokensActive thrown when conversion is already active\n /// @custom:access Restricted by ACM\n function resumeConversion() external {\n _checkAccessAllowed(\"resumeConversion()\");\n if (!conversionPaused) {\n revert ConversionTokensActive();\n }\n\n conversionPaused = false;\n emit ConversionResumed(msg.sender);\n }\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:access Only Governance\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\n _setPriceOracle(priceOracle_);\n }\n\n /// @notice Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:access Only Governance\n function setDestination(address destinationAddress_) external onlyOwner {\n _setDestination(destinationAddress_);\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:access Only Governance\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\n _setConverterNetwork(converterNetwork_);\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:access Only Governance\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\n _checkAccessAllowed(\"setMinAmountToConvert(uint256)\");\n _setMinAmountToConvert(minAmountToConvert_);\n }\n\n /// @notice Batch sets the conversion configurations\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressesOut Array of addresses of tokenOut\n /// @param conversionConfigs Array of conversionConfig config details to update\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\n function setConversionConfigs(\n address tokenAddressIn,\n address[] calldata tokenAddressesOut,\n ConversionConfig[] calldata conversionConfigs\n ) external {\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\n\n for (uint256 i; i < tokenOutArrayLength; ) {\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountIn != amountInMantissa) {\n revert AmountInMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\n /// otherwise the amount is adjusted\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountOut != amountOutMantissa) {\n revert AmountOutMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\n /// @param tokenAddress The address of the ERC-20 token to sweep\n /// @param to The address to which tokens will be transferred\n /// @param amount The amount to transfer\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\n /// @dev This function retrieves values without altering token prices\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n amountConvertedMantissa = amountInMantissa;\n uint256 tokenInToOutConversion;\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountConvertedMantissa = _divRoundingUp(maxTokenOutReserve * EXP_SCALE, tokenInToOutConversion);\n amountOutMantissa = maxTokenOutReserve;\n }\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @dev This function retrieves values without altering token prices\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountOutMantissa = maxTokenOutReserve;\n }\n\n amountConvertedMantissa = amountOutMantissa;\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountInMantissa;\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountOutMantissa;\n }\n\n /// @notice This method updated the states of this contract after getting funds from PSR\n /// after settling the amount(if any) through privateConversion between converters\n /// @dev This function is called by protocolShareReserve\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\n if (balanceDiff > 0) {\n _privateConversion(comptroller, asset, balanceDiff);\n }\n }\n\n /// @notice Set the configuration for new or existing conversion pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n /// @custom:event Emits ConversionConfigUpdated event on success\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\n /// @custom:access Controlled by AccessControlManager\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) public {\n _checkAccessAllowed(\"setConversionConfig(address,address,ConversionConfig)\");\n ensureNonzeroAddress(tokenAddressIn);\n ensureNonzeroAddress(tokenAddressOut);\n\n if (conversionConfig.incentive > MAX_INCENTIVE) {\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\n }\n\n if (\n (tokenAddressIn == tokenAddressOut) ||\n (tokenAddressIn != _getDestinationBaseAsset()) ||\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\n ) {\n revert InvalidTokenConfigAddresses();\n }\n\n if (\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\n conversionConfig.incentive != 0\n ) {\n revert NonZeroIncentiveForPrivateConversion();\n }\n\n if (\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\n (address(converterNetwork) == address(0))\n ) {\n revert InvalidConverterNetwork();\n }\n\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n emit ConversionConfigUpdated(\n tokenAddressIn,\n tokenAddressOut,\n configuration.incentive,\n conversionConfig.incentive,\n configuration.conversionAccess,\n conversionConfig.conversionAccess\n );\n\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\n } else {\n configuration.incentive = conversionConfig.incentive;\n configuration.conversionAccess = conversionConfig.conversionAccess;\n }\n }\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\n\n /// @dev Operations to perform before sweeping tokens\n /// @param token Address of the token\n /// @param amount Amount transferred to address(to)\n function preSweepToken(address token, uint256 amount) internal virtual {}\n\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function _convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n if (amountOutMantissa < amountOutMinMantissa) {\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n }\n\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\n /// it is called by convertForExactTokens function\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n if (actualAmountIn != amountInMantissa) {\n revert DeflationaryTokenNotSupported();\n }\n\n if (actualAmountIn > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n actualAmountOut = amountOutMantissa;\n }\n\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n if (amountInMantissa > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\n }\n\n /// @dev return actualAmountOut from reserves for tokenAddressOut\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\n function _doTransferOut(\n address tokenAddressOut,\n address to,\n uint256 amountConvertedMantissa\n ) internal {\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountConvertedMantissa) {\n revert InsufficientPoolLiquidity();\n }\n\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\n\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\n tokenOut.safeTransfer(to, amountConvertedMantissa);\n }\n\n /// @notice Transfer tokenAddressIn from user to destination\n /// @param tokenAddressIn Address of the token to convert\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @return actualAmountIn Actual amount transferred to destination\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\n }\n\n /// @dev Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:event Emits PriceOracleUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\n ensureNonzeroAddress(address(priceOracle_));\n emit PriceOracleUpdated(priceOracle, priceOracle_);\n priceOracle = priceOracle_;\n }\n\n /// @dev Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:event Emits DestinationAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\n function _setDestination(address destinationAddress_) internal {\n ensureNonzeroAddress(destinationAddress_);\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\n destinationAddress = destinationAddress_;\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\n ensureNonzeroAddress(address(converterNetwork_));\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\n converterNetwork = converterNetwork_;\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:event MinAmountToConvertUpdated is emitted in success\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\n ensureNonzeroValue(minAmountToConvert_);\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\n minAmountToConvert = minAmountToConvert_;\n }\n\n /// @dev Hook to perform after converting tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param amountIn Amount of tokenIn converted\n /// @param amountOut Amount of tokenOut converted\n function _postConversionHook(\n address tokenAddressIn,\n address tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n ) internal virtual {}\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init_unchained(\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n _setPriceOracle(priceOracle_);\n _setDestination(destinationAddress_);\n _setMinAmountToConvert(minAmountToConvert_);\n conversionPaused = false;\n }\n\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return Amount of asset, for _privateConversion\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\n\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\n /// destination contract as destination's base asset\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\n function _privateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 amountToConvert\n ) internal {\n address tokenAddressIn = _getDestinationBaseAsset();\n address _destinationAddress = destinationAddress;\n uint256 convertedTokenInBalance;\n if (address(converterNetwork) != address(0)) {\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\n uint256 convertersLength = converterAddresses.length;\n for (uint256 i; i < convertersLength; ) {\n if (converterBalances[i] == 0) break;\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\n converterBalances[i],\n tokenAddressOut,\n tokenAddressIn\n );\n if (amountIn > amountToConvert) {\n amountIn = amountToConvert;\n }\n\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\n break;\n }\n\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n\n IERC20Upgradeable(tokenAddressOut).forceApprove(converterAddresses[i], amountIn);\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\n amountIn,\n 0,\n tokenAddressOut,\n tokenAddressIn,\n _destinationAddress\n );\n\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n amountToConvert -= amountIn;\n convertedTokenInBalance += (balanceAfter - balanceBefore);\n\n if (amountToConvert == 0) break;\n unchecked {\n ++i;\n }\n }\n }\n\n _postPrivateConversionHook(\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance,\n tokenAddressOut,\n amountToConvert\n );\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal virtual {}\n\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\n\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\n /// @param amountIn The amount to convert\n /// @param tokenAddress Address of the token\n /// @return isValid true if amount to convert is greater than minimum amount to convert\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\n priceOracle.updateAssetPrice(tokenAddress);\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\n\n if (amountInInUsd >= minAmountToConvert) {\n isValid = true;\n }\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\n if (amountInMantissa == 0) {\n revert InsufficientInputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\n /// multiplied by conversionWithIncentive which will be >= 1\n amountOutMantissa = (amountInMantissa * tokenInToOutConversion) / (EXP_SCALE);\n }\n\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\n if (amountOutMantissa == 0) {\n revert InsufficientOutputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\n converterNetwork.isTokenConverter(msg.sender);\n if (isPrivateConversion) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\n if (isPrivateConversion) {\n amountInMantissa =\n (amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE) /\n (tokenInUnderlyingPrice * conversionWithIncentive);\n } else {\n amountInMantissa = _divRoundingUp(\n amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE,\n tokenInUnderlyingPrice * conversionWithIncentive\n );\n }\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n }\n\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\n if (\n (!(isConverter) &&\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n }\n\n /// @dev To check, is conversion paused\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\n function _checkConversionPaused() internal view {\n if (conversionPaused) {\n revert ConversionTokensPaused();\n }\n }\n\n /// @dev Get base asset address of the destination contract\n /// @return Address of the base asset\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\n\n /// @dev Performs division where the result is rounded up\n /// @param numerator The numerator of the division operation\n /// @param denominator The denominator of the division operation. Must be non-zero\n /// @return The result of the division, rounded up\n function _divRoundingUp(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\n return (numerator + denominator - 1) / denominator;\n }\n}\n" + }, + "contracts/TokenConverter/ConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { sort } from \"../Utils/ArrayHelpers.sol\";\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title ConverterNetwork\n/// @author Venus\n/// @notice ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ConverterNetwork is IConverterNetwork, AccessControlledV8, MaxLoopsLimitHelper {\n /// @notice Array holding all the converters\n IAbstractTokenConverter[] public allConverters;\n\n /// @notice Emitted when new converter is added\n event ConverterAdded(address indexed converter);\n\n /// @notice Emitted when converter is removed\n event ConverterRemoved(address indexed converter);\n\n /// @notice Error thrown when converter already exists\n error ConverterAlreadyExists();\n\n /// @notice Error thrown converter does not exist\n error ConverterDoesNotExist();\n\n /// @notice Error thrown when converter address is invalid\n error InvalidTokenConverterAddress();\n\n /// @notice Error thrown when loops limit is invalid\n error InvalidMaxLoopsLimit(uint256 loopsLimit);\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @notice ConverterNetwork initializer\n /// @param _accessControlManager The address of ACM contract\n /// @param _loopsLimit Limit for the loops in the contract to avoid DOS\n /// @custom:event ConverterAdded is emitted for each converter added on success\n /// @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n ensureNonzeroAddress(_accessControlManager);\n __AccessControlled_init(_accessControlManager);\n\n if (_loopsLimit >= type(uint128).max) revert InvalidMaxLoopsLimit(_loopsLimit);\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n * @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n * @custom:access Only owner\n */\n function setMaxLoopsLimit(uint256 limit) external onlyOwner {\n if (limit >= type(uint128).max) revert InvalidMaxLoopsLimit(limit);\n _setMaxLoopsLimit(limit);\n }\n\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:event ConverterAdded is emitted on success\n /// @custom:access Only Governance\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"addTokenConverter(address)\");\n _addTokenConverter(_tokenConverter);\n }\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterDoesNotExist is thrown when converter to remove does not exist\n /// @custom:event ConverterRemoved is emitted on success\n /// @custom:access Only Governance\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"removeTokenConverter(address)\");\n\n // Find the index of the converter in the array\n uint128 indexToRemove = _findConverterIndex(_tokenConverter);\n\n // Ensure that the converter exists in the array\n if (indexToRemove == type(uint128).max) revert ConverterDoesNotExist();\n\n // Swap the element to remove with the last element\n allConverters[indexToRemove] = allConverters[allConverters.length - 1];\n\n // Remove the last element (which is now a duplicate)\n allConverters.pop();\n\n emit ConverterRemoved(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to users for conversion\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, false);\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to converters for conversion.\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, true);\n }\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return converters Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory converters) {\n converters = allConverters;\n }\n\n /// @notice This function checks if the given address is a converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return isConverter true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool isConverter) {\n uint128 index = _findConverterIndex(IAbstractTokenConverter(_tokenConverter));\n\n if (index != type(uint128).max) {\n isConverter = true;\n }\n }\n\n /// @notice Adds new converter contract to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterAlreadyExists is thrown when new tokenconverter to add already exists\n /// @custom:event ConverterAdded is emitted on success\n function _addTokenConverter(IAbstractTokenConverter _tokenConverter) internal {\n if (\n (address(_tokenConverter) == address(0)) || (address(_tokenConverter.converterNetwork()) != address(this))\n ) {\n revert InvalidTokenConverterAddress();\n }\n\n uint128 index = _findConverterIndex(_tokenConverter);\n if (index != type(uint128).max) revert ConverterAlreadyExists();\n\n allConverters.push(_tokenConverter);\n _ensureMaxLoops(allConverters.length);\n\n emit ConverterAdded(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @param forConverters Bool to filter out converters on the basis of the conversionAccess\n /// @return converters Array of converters\n /// @return convertersBalance Array of balances with respect to token out\n function _findTokenConverters(\n address _tokenAddressIn,\n address _tokenAddressOut,\n bool forConverters\n ) internal returns (address[] memory converters, uint256[] memory convertersBalance) {\n uint128 convertersLength = uint128(allConverters.length);\n\n // Create a dynamic array to store the matching converters\n converters = new address[](convertersLength);\n convertersBalance = new uint256[](convertersLength);\n uint128 count;\n\n for (uint128 i; i < convertersLength; ) {\n IAbstractTokenConverter converter = allConverters[i];\n\n unchecked {\n ++i;\n }\n\n if ((address(converter.converterNetwork()) != address(this)) || msg.sender == address(converter)) {\n continue;\n }\n\n (, IAbstractTokenConverter.ConversionAccessibility conversionAccess) = converter.conversionConfigurations(\n _tokenAddressIn,\n _tokenAddressOut\n );\n\n if (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ALL) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n forConverters &&\n (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_CONVERTERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n !forConverters && (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_USERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n }\n }\n\n // Resize the array to the actual number of matching converters\n assembly {\n mstore(converters, count)\n mstore(convertersBalance, count)\n }\n sort(convertersBalance, converters);\n }\n\n /// @notice Used to get the index of the converter stored in the array\n /// This will return the index if the converter exists in the array otherwise will return type(uint128).max\n /// @param _tokenConverter Address of the token converter\n /// @return index of the converter address in the allConverters array\n function _findConverterIndex(IAbstractTokenConverter _tokenConverter) internal view returns (uint128 index) {\n index = type(uint128).max; // Not found, return a large value\n\n uint128 convertersLength = uint128(allConverters.length);\n for (uint128 i; i < convertersLength; ) {\n if (allConverters[i] == _tokenConverter) {\n index = i;\n }\n unchecked {\n ++i;\n }\n }\n }\n}\n" + }, + "contracts/TokenConverter/IAbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @notice Interface for AbstractTokenConverter\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ninterface IAbstractTokenConverter {\n /// @notice This enum define the all possible ways of conversion can happen\n enum ConversionAccessibility {\n NONE, // Conversion is disable for the pair\n ALL, // Conversion is enable for private conversion and users\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\n ONLY_FOR_USERS // Conversion is enable only for users\n }\n\n /// @notice This struct represents the configuration for a token conversion.\n struct ConversionConfig {\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\n uint256 incentive;\n /// enable or disable conversion for users or converters or both or none\n ConversionAccessibility conversionAccess;\n }\n\n /// @notice Pause conversion of tokens\n function pauseConversion() external;\n\n /// @notice Resume conversion of tokens.\n function resumeConversion() external;\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n function setPriceOracle(ResilientOracle priceOracle_) external;\n\n /// @notice Set the configuration for new or existing convert pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) external;\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Get the configuration for the pair of the tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\n /// @return conversionAccess Accessibility for the pair of tokens\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\n external\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\n\n /// @notice Get the address of the converterNetwork\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) external view returns (uint256 tokenBalance);\n}\n" + }, + "contracts/TokenConverter/RiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IRiskFund, IRiskFundGetters } from \"../Interfaces/IRiskFund.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\n\n/// @title RiskFundConverter\n/// @author Venus\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the core pool comptroller\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n ///@notice Address of the vBNB\n ///@dev This address is used to include the BNB market while in getPools method\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable VBNB;\n\n ///@notice Address of the native wrapped currency\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable NATIVE_WRAPPED;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) internal assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\n\n /// @notice Address of pool registry contract\n address public poolRegistry;\n\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\n\n // Error thrown when comptrollers array length is not equal to assets array length\n error InvalidArguments();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice thrown when asset does not exist in the pool\n error MarketNotExistInPool(address comptroller, address asset);\n\n /// @notice thrown to prevent reentrancy\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\n /// cannot be called recursively within the same transaction.\n error ReentrancyGuardError();\n\n /// @param corePoolComptroller_ Address of the Comptroller pool\n /// @param vBNB_ Address of the vBNB\n /// @param nativeWrapped_ Address of the wrapped native currency\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) {\n ensureNonzeroAddress(corePoolComptroller_);\n ensureNonzeroAddress(vBNB_);\n ensureNonzeroAddress(nativeWrapped_);\n\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\n VBNB = vBNB_;\n NATIVE_WRAPPED = nativeWrapped_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param poolRegistry_ Address of the pool registry\n /// @param minAmountToConvert_ minimum amount to convert\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address poolRegistry_,\n uint256 minAmountToConvert_,\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) public initializer {\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n ensureNonzeroAddress(poolRegistry_);\n poolRegistry = poolRegistry_;\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Pool registry setter\n /// @param poolRegistry_ Address of the pool registry\n /// @custom:event PoolRegistryUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:access Only Governance\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\n ensureNonzeroAddress(poolRegistry_);\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\n poolRegistry = poolRegistry_;\n }\n\n /// @notice Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:access Restricted by ACM\n function setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) external {\n _checkAccessAllowed(\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\");\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return reserves Asset's reserve in risk fund\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n reserves = poolsAssetsReserves[comptroller][asset];\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Reserves of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n tokenBalance = assetsReserves[tokenAddress];\n }\n\n /// @notice Get the array of all pools addresses\n /// @param tokenAddress Address of the token\n /// @return poolsWithCore Array of the pools addresses in which token is available\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\n\n if (isAssetListedInCore(tokenAddress)) {\n uint256 poolsLength = poolsWithCore.length;\n address[] memory extendedPools = new address[](poolsLength + 1);\n\n for (uint256 i; i < poolsLength; ) {\n extendedPools[i] = poolsWithCore[i];\n unchecked {\n ++i;\n }\n }\n\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\n poolsWithCore = extendedPools;\n }\n }\n\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\n assetsReserves[tokenOutAddress] -= amountOut;\n }\n\n /// @notice Hook to perform after converting tokens\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\n /// @param tokenInAddress Address of the tokenIn\n /// @param tokenOutAddress Address of the tokenOut\n /// @param amountIn Amount of tokenIn transferred\n /// @param amountOut Amount of tokenOut transferred\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\n function _postConversionHook(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) internal override {\n address[] memory pools = getPools(tokenOutAddress);\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\n ensureNonzeroValue(assetReserve);\n\n uint256 poolsLength = pools.length;\n uint256 distributedOutShare;\n uint256 poolAmountInShare;\n uint256 distributedInShare;\n\n for (uint256 i; i < poolsLength; ) {\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\n if (currentPoolsAssetsReserves != 0) {\n if (i < (poolsLength - 1)) {\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\n distributedInShare += poolAmountInShare;\n } else {\n uint256 distributedDiff = amountOut - distributedOutShare;\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\n poolAmountInShare = amountIn - distributedInShare;\n }\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n\n address[] memory pools = getPools(tokenAddress);\n uint256 assetReserve = assetsReserves[tokenAddress];\n uint256 poolsLength = pools.length;\n uint256 distributedShare;\n\n for (uint256 i; i < poolsLength; ) {\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\n if (i < (poolsLength - 1)) {\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\n } else {\n uint256 distributedDiff = amountDiff - distributedShare;\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\n }\n }\n unchecked {\n ++i;\n }\n }\n assetsReserves[tokenAddress] -= amountDiff;\n }\n }\n\n /// @dev Update the poolAssetsReserves upon transferring the tokens\n /// @param pool Address of the pool\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @param assetReserve Asset's reserve for the pool\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\n /// @custom:event AssetsReservesUpdated emits on success\n function updatePoolAssetsReserve(\n address pool,\n address tokenAddress,\n uint256 amount,\n uint256 assetReserve\n ) internal returns (uint256 poolAmountShare) {\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\n }\n\n /// @dev Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\n function _setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) internal {\n uint256 comptrollersLength = comptrollers.length;\n\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\n revert InvalidArguments();\n }\n\n for (uint256 i; i < comptrollersLength; ) {\n address[] memory poolAssets = assets[i];\n bool[] memory assetsValues = values[i];\n uint256 poolAssetsLength = poolAssets.length;\n\n if (poolAssetsLength != assetsValues.length) {\n revert InvalidArguments();\n }\n\n for (uint256 j; j < poolAssetsLength; ) {\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\n unchecked {\n ++j;\n }\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// and transferring funds to the protocol share reserve\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return balanceDifference Amount of asset, for _privateConversion\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n function _updateAssetsState(address comptroller, address asset)\n internal\n override\n returns (uint256 balanceDifference)\n {\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 currentBalance = token.balanceOf(address(this));\n uint256 assetReserve = assetsReserves[asset];\n if (currentBalance > assetReserve) {\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\n token.safeTransfer(destinationAddress, balanceDifference);\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\n\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\n IRiskFund(destinationAddress).updatePoolState(\n comptroller,\n asset,\n newDestinationBalance - previousDestinationBalance\n );\n balanceDifference = 0;\n }\n }\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n emit AssetTransferredToDestination(\n destinationAddress,\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance\n );\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @dev This function checks for the given asset is listed in core pool or not\n /// @param tokenAddress Address of the asset\n /// @return isAssetListed true if the asset is listed\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\n\n uint256 coreMarketsLength = coreMarkets.length;\n for (uint256 i; i < coreMarketsLength; ) {\n isAssetListed = (VBNB == coreMarkets[i])\n ? (tokenAddress == NATIVE_WRAPPED)\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\n\n if (isAssetListed) {\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev This function checks for the given asset is listed or not\n /// @param comptroller Address of the comptroller\n /// @param asset Address of the asset\n /// @return isListed true if the asset is listed\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\n if (comptroller == CORE_POOL_COMPTROLLER) {\n isListed = isAssetListedInCore(asset);\n } else {\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\n }\n }\n\n /// @dev Get base asset address of the RiskFund\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/TokenConverter/SingleTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\n\n/// @title SingleTokenConverter\n/// @author Venus\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract SingleTokenConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the base asset token\n address public baseAsset;\n\n /// @notice Emitted when base asset is updated\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param baseAsset_ Address of the base asset\n /// @param minAmountToConvert_ Minimum amount to convert\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address baseAsset_,\n uint256 minAmountToConvert_\n ) public initializer {\n _setBaseAsset(baseAsset_);\n\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @notice Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:access Only Governance\n function setBaseAsset(address baseAsset_) external onlyOwner {\n _setBaseAsset(baseAsset_);\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address.\n /// @return balanceLeft Amount of asset, for _privateConversion\n // solhint-disable-next-line\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 balance = token.balanceOf(address(this));\n balanceLeft = balance;\n\n if (asset == baseAsset) {\n balanceLeft = 0;\n token.safeTransfer(destinationAddress, balance);\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\n }\n }\n\n /// @dev Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n /// @custom:event BaseAssetUpdated is emitted on success\n function _setBaseAsset(address baseAsset_) internal {\n ensureNonzeroAddress(baseAsset_);\n emit BaseAssetUpdated(baseAsset, baseAsset_);\n baseAsset = baseAsset_;\n }\n\n /// @dev Get base asset address\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = baseAsset;\n }\n}\n" + }, + "contracts/Utils/ArrayHelpers.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\nfunction sort(uint256[] memory arr, address[] memory addrs) pure {\n if (arr.length > 1) {\n return quickSortDescending(arr, addrs, 0, arr.length - 1);\n }\n}\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\n/// @param left index of first value\n/// @param right index of last value\nfunction quickSortDescending(\n uint256[] memory arr,\n address[] memory addrs,\n uint256 left,\n uint256 right\n) pure {\n if (left >= right) return;\n uint256 p = arr[(left + right) / 2]; // p = the pivot element\n uint256 i = left;\n uint256 j = right;\n while (i < j) {\n while (arr[i] > p) ++i;\n while (arr[j] < p) --j; // arr[j] < p means p still to the right, so j > 0\n if (arr[i] < arr[j]) {\n (arr[i], arr[j]) = (arr[j], arr[i]);\n (addrs[i], addrs[j]) = (addrs[j], addrs[i]);\n } else {\n ++i;\n }\n }\n\n if (j > left) quickSortDescending(arr, addrs, left, j - 1); // j > left, so j > 0\n quickSortDescending(arr, addrs, j + 1, right);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \"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 require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(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 require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(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 require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason 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 // 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\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}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} From c6c2f501d6711bd176c97c713d41fe20d2eefa92 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 19 Nov 2024 20:34:55 +0530 Subject: [PATCH 13/24] feat: converter network deployment files on arbitrum one --- deployments/arbitrumone/ConverterNetwork.json | 723 +++++++++++++++ .../ConverterNetwork_Implementation.json | 828 ++++++++++++++++++ .../arbitrumone/ConverterNetwork_Proxy.json | 277 ++++++ 3 files changed, 1828 insertions(+) create mode 100644 deployments/arbitrumone/ConverterNetwork.json create mode 100644 deployments/arbitrumone/ConverterNetwork_Implementation.json create mode 100644 deployments/arbitrumone/ConverterNetwork_Proxy.json diff --git a/deployments/arbitrumone/ConverterNetwork.json b/deployments/arbitrumone/ConverterNetwork.json new file mode 100644 index 00000000..203bdfd8 --- /dev/null +++ b/deployments/arbitrumone/ConverterNetwork.json @@ -0,0 +1,723 @@ +{ + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "ConverterAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + } + ], + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConvertersForConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "transactionIndex": 1, + "gasUsed": "2453945", + "logsBloom": "0x00000000000000040000000000000004400000000000000000800000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000010000000400000000000000000000000000000000000000000000080000002000000800000000000000000000000002000000400000000000000800000000000000000000000000020000000000000000001040000000000000400000000000400000020000000000200000000000000000000000000000800000000000000000000000000", + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d", + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000f4b78771044d21f8289238cad82ba5a13076aa4d" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 2, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 3, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6ff3e9459227f0cde8b102b90be25960317b216", + "logIndex": 5, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + } + ], + "blockNumber": 276074336, + "cumulativeGasUsed": "2453945", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", + "0xcd6dc687000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b1570000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": ["0xD9dD18EB0cf10CbA837677f28A8F9Bda4bc2b157", 20] + }, + "implementation": "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/arbitrumone/ConverterNetwork_Implementation.json b/deployments/arbitrumone/ConverterNetwork_Implementation.json new file mode 100644 index 00000000..ecf67ee3 --- /dev/null +++ b/deployments/arbitrumone/ConverterNetwork_Implementation.json @@ -0,0 +1,828 @@ +{ + "address": "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConverterAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + } + ], + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "converter", + "type": "address" + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "allConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", + "type": "address" + } + ], + "name": "findTokenConvertersForConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getAllConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + } + ], + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xbd6285224f1f7c7e4858fa6044a13a82f3bf638aa2e84de5ba35871342ff2fb9", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "transactionIndex": 1, + "gasUsed": "4416236", + "logsBloom": "0x00000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000", + "blockHash": "0x0f1663b767a386aa61eae4b8d8a282879e09d1aea8dd211304097f7c29312181", + "transactionHash": "0xbd6285224f1f7c7e4858fa6044a13a82f3bf638aa2e84de5ba35871342ff2fb9", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 276074311, + "transactionHash": "0xbd6285224f1f7c7e4858fa6044a13a82f3bf638aa2e84de5ba35871342ff2fb9", + "address": "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 0, + "blockHash": "0x0f1663b767a386aa61eae4b8d8a282879e09d1aea8dd211304097f7c29312181" + } + ], + "blockNumber": 276074311, + "cumulativeGasUsed": "4416236", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "027aeec938943227f90cf24126ba2c44", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ConverterAlreadyExists\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConverterDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"loopsLimit\",\"type\":\"uint256\"}],\"name\":\"InvalidMaxLoopsLimit\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTokenConverterAddress\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"loopsLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredLoops\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converter\",\"type\":\"address\"}],\"name\":\"ConverterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"converter\",\"type\":\"address\"}],\"name\":\"ConverterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMaxLoopsLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newmaxLoopsLimit\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IAbstractTokenConverter\",\"name\":\"_tokenConverter\",\"type\":\"address\"}],\"name\":\"addTokenConverter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"allConverters\",\"outputs\":[{\"internalType\":\"contract IAbstractTokenConverter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenAddressOut\",\"type\":\"address\"}],\"name\":\"findTokenConverters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"converters\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"convertersBalance\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddressIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_tokenAddressOut\",\"type\":\"address\"}],\"name\":\"findTokenConvertersForConverters\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"converters\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"convertersBalance\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllConverters\",\"outputs\":[{\"internalType\":\"contract IAbstractTokenConverter[]\",\"name\":\"converters\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_loopsLimit\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_tokenConverter\",\"type\":\"address\"}],\"name\":\"isTokenConverter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"isConverter\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLoopsLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IAbstractTokenConverter\",\"name\":\"_tokenConverter\",\"type\":\"address\"}],\"name\":\"removeTokenConverter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"setMaxLoopsLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"custom:security-contact\":\"https://github.com/VenusProtocol/protocol-reserve#discussion\",\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"addTokenConverter(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"ConverterAdded is emitted on success\",\"params\":{\"_tokenConverter\":\"Address of the token converter\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"findTokenConverters(address,address)\":{\"params\":{\"_tokenAddressIn\":\"Address of tokenIn\",\"_tokenAddressOut\":\"Address of tokenOut\"},\"returns\":{\"converters\":\"Array of the conveters on the basis of the tokens pair\",\"convertersBalance\":\"Array of balances with respect to token out\"}},\"findTokenConvertersForConverters(address,address)\":{\"params\":{\"_tokenAddressIn\":\"Address of tokenIn\",\"_tokenAddressOut\":\"Address of tokenOut\"},\"returns\":{\"converters\":\"Array of the conveters on the basis of the tokens pair\",\"convertersBalance\":\"Array of balances with respect to token out\"}},\"getAllConverters()\":{\"returns\":{\"converters\":\"Array containing all the converters addresses\"}},\"initialize(address,uint256)\":{\"custom:error\":\"InvalidMaxLoopsLimit is thrown when when loops limit is invalid\",\"custom:event\":\"ConverterAdded is emitted for each converter added on success\",\"params\":{\"_accessControlManager\":\"The address of ACM contract\",\"_loopsLimit\":\"Limit for the loops in the contract to avoid DOS\"}},\"isTokenConverter(address)\":{\"params\":{\"_tokenConverter\":\"Address of the token converter\"},\"returns\":{\"isConverter\":\"true if given address is converter otherwise false\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"removeTokenConverter(address)\":{\"custom:access\":\"Only Governance\",\"custom:error\":\"ConverterDoesNotExist is thrown when converter to remove does not exist\",\"custom:event\":\"ConverterRemoved is emitted on success\",\"params\":{\"_tokenConverter\":\"Address of the token converter\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setMaxLoopsLimit(uint256)\":{\"custom:access\":\"Only owner\",\"custom:error\":\"InvalidMaxLoopsLimit is thrown when when loops limit is invalid\",\"params\":{\"limit\":\"Limit for the max loops can execute at a time\"}},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"}},\"title\":\"ConverterNetwork\",\"version\":1},\"userdoc\":{\"errors\":{\"ConverterAlreadyExists()\":[{\"notice\":\"Error thrown when converter already exists\"}],\"ConverterDoesNotExist()\":[{\"notice\":\"Error thrown converter does not exist\"}],\"InvalidMaxLoopsLimit(uint256)\":[{\"notice\":\"Error thrown when loops limit is invalid\"}],\"InvalidTokenConverterAddress()\":[{\"notice\":\"Error thrown when converter address is invalid\"}],\"MaxLoopsLimitExceeded(uint256,uint256)\":[{\"notice\":\"Thrown an error on maxLoopsLimit exceeds for any loop\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}]},\"events\":{\"ConverterAdded(address)\":{\"notice\":\"Emitted when new converter is added\"},\"ConverterRemoved(address)\":{\"notice\":\"Emitted when converter is removed\"},\"MaxLoopsLimitUpdated(uint256,uint256)\":{\"notice\":\"Emitted when max loops limit is set\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"}},\"kind\":\"user\",\"methods\":{\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"addTokenConverter(address)\":{\"notice\":\"Adds new converter to the array\"},\"allConverters(uint256)\":{\"notice\":\"Array holding all the converters\"},\"findTokenConverters(address,address)\":{\"notice\":\"Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to users for conversion\"},\"findTokenConvertersForConverters(address,address)\":{\"notice\":\"Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to converters for conversion.\"},\"getAllConverters()\":{\"notice\":\"This function returns the array containing all the converters addresses\"},\"initialize(address,uint256)\":{\"notice\":\"ConverterNetwork initializer\"},\"isTokenConverter(address)\":{\"notice\":\"This function checks if the given address is a converter or not\"},\"removeTokenConverter(address)\":{\"notice\":\"Removes converter from the array\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"setMaxLoopsLimit(uint256)\":{\"notice\":\"Set the limit for the loops can iterate to avoid the DOS\"}},\"notice\":\"ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TokenConverter/ConverterNetwork.sol\":\"ConverterNetwork\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n function __Pausable_init() internal onlyInitializing {\\n __Pausable_init_unchained();\\n }\\n\\n function __Pausable_init_unchained() internal onlyInitializing {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x40c636b4572ff5f1dc50cf22097e93c0723ee14eff87e99ac2b02636eeca1250\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/ResilientOracle.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\n// SPDX-FileCopyrightText: 2022 Venus\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\\\";\\nimport \\\"./interfaces/VBep20Interface.sol\\\";\\nimport \\\"./interfaces/OracleInterface.sol\\\";\\nimport \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\n\\n/**\\n * @title ResilientOracle\\n * @author Venus\\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\\n * \\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\\n * for attacking the protocol.\\n * \\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\\n * \\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per \\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot \\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source. \\n * \\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\\n * market. The upper bound ratio represents the deviation between reported price (the price that\\u2019s being\\n * validated) and the anchor price (the price we are validating against) above which the reported price will\\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\\n * should be true:\\n\\n```\\nanchorRatio = anchorPrice/reporterPrice\\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\\n```\\n\\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles. \\n * \\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\\n * oracle to be stagnant and treat it like it's disabled.\\n */\\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\\n /**\\n * @dev Oracle roles:\\n * **main**: The most trustworthy price source\\n * **pivot**: Price oracle used as a loose sanity checker\\n * **fallback**: The backup source when main oracle price is invalidated\\n */\\n enum OracleRole {\\n MAIN,\\n PIVOT,\\n FALLBACK\\n }\\n\\n struct TokenConfig {\\n /// @notice asset address\\n address asset;\\n /// @notice `oracles` stores the oracles based on their role in the following order:\\n /// [main, pivot, fallback],\\n /// It can be indexed with the corresponding enum OracleRole value\\n address[3] oracles;\\n /// @notice `enableFlagsForOracles` stores the enabled state\\n /// for each oracle in the same order as `oracles`\\n bool[3] enableFlagsForOracles;\\n }\\n\\n uint256 public constant INVALID_PRICE = 0;\\n\\n /// @notice Native market address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable nativeMarket;\\n\\n /// @notice VAI address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vai;\\n\\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\\n /// and can serve as any underlying asset of a market that supports native tokens\\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\\n\\n /// @notice Bound validator contract address\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n BoundValidatorInterface public immutable boundValidator;\\n\\n mapping(address => TokenConfig) private tokenConfigs;\\n\\n event TokenConfigAdded(\\n address indexed asset,\\n address indexed mainOracle,\\n address indexed pivotOracle,\\n address fallbackOracle\\n );\\n\\n /// Event emitted when an oracle is set\\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\\n\\n /// Event emitted when an oracle is enabled or disabled\\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\\n\\n /**\\n * @notice Checks whether an address is null or not\\n */\\n modifier notNullAddress(address someone) {\\n if (someone == address(0)) revert(\\\"can't be zero address\\\");\\n _;\\n }\\n\\n /**\\n * @notice Checks whether token config exists by checking whether asset is null address\\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\\n * @param asset asset address\\n */\\n modifier checkTokenConfigExistence(address asset) {\\n if (tokenConfigs[asset].asset == address(0)) revert(\\\"token config must exist\\\");\\n _;\\n }\\n\\n /// @notice Constructor for the implementation contract. Sets immutable variables.\\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\\n /// (e.g vETH on ethereum would not be supported, only vWETH)\\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\\n /// Set to address(0) of VAI is not existent.\\n /// @param _boundValidator Address of the bound validator contract\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address nativeMarketAddress,\\n address vaiAddress,\\n BoundValidatorInterface _boundValidator\\n ) notNullAddress(address(_boundValidator)) {\\n nativeMarket = nativeMarketAddress;\\n vai = vaiAddress;\\n boundValidator = _boundValidator;\\n\\n _disableInitializers();\\n }\\n\\n /**\\n * @notice Initializes the contract admin and sets the BoundValidator contract address\\n * @param accessControlManager_ Address of the access control manager contract\\n */\\n function initialize(address accessControlManager_) external initializer {\\n __AccessControlled_init(accessControlManager_);\\n __Pausable_init();\\n }\\n\\n /**\\n * @notice Pauses oracle\\n * @custom:access Only Governance\\n */\\n function pause() external {\\n _checkAccessAllowed(\\\"pause()\\\");\\n _pause();\\n }\\n\\n /**\\n * @notice Unpauses oracle\\n * @custom:access Only Governance\\n */\\n function unpause() external {\\n _checkAccessAllowed(\\\"unpause()\\\");\\n _unpause();\\n }\\n\\n /**\\n * @notice Batch sets token configs\\n * @param tokenConfigs_ Token config array\\n * @custom:access Only Governance\\n * @custom:error Throws a length error if the length of the token configs array is 0\\n */\\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\\n if (tokenConfigs_.length == 0) revert(\\\"length can't be 0\\\");\\n uint256 numTokenConfigs = tokenConfigs_.length;\\n for (uint256 i; i < numTokenConfigs; ) {\\n setTokenConfig(tokenConfigs_[i]);\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @notice Sets oracle for a given asset and role.\\n * @dev Supplied asset **must** exist and main oracle may not be null\\n * @param asset Asset address\\n * @param oracle Oracle address\\n * @param role Oracle role\\n * @custom:access Only Governance\\n * @custom:error Null address error if main-role oracle address is null\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\\n */\\n function setOracle(\\n address asset,\\n address oracle,\\n OracleRole role\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"setOracle(address,address,uint8)\\\");\\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\\\"can't set zero address to main oracle\\\");\\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\\n emit OracleSet(asset, oracle, uint256(role));\\n }\\n\\n /**\\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\\n * @param asset Asset address\\n * @param role Oracle role\\n * @param enable Enabled boolean of the oracle\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress error is thrown if asset address is null\\n * @custom:error TokenConfigExistance error is thrown if token config is not set\\n */\\n function enableOracle(\\n address asset,\\n OracleRole role,\\n bool enable\\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\\n _checkAccessAllowed(\\\"enableOracle(address,uint8,bool)\\\");\\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\\n emit OracleEnabled(asset, uint256(role), enable);\\n }\\n\\n /**\\n * @notice Updates the TWAP pivot oracle price.\\n * @dev This function should always be called before calling getUnderlyingPrice\\n * @param vToken vToken address\\n */\\n function updatePrice(address vToken) external override {\\n address asset = _getUnderlyingAsset(vToken);\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @notice Updates the pivot oracle price. Currently using TWAP\\n * @dev This function should always be called before calling getPrice\\n * @param asset asset address\\n */\\n function updateAssetPrice(address asset) external {\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracle != address(0) && pivotOracleEnabled) {\\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\\n }\\n }\\n\\n /**\\n * @dev Gets token config by asset address\\n * @param asset asset address\\n * @return tokenConfig Config for the asset\\n */\\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\\n return tokenConfigs[asset];\\n }\\n\\n /**\\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\\n * - Check if the oracle is paused globally\\n * - Validate price from main oracle against pivot oracle\\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\\n * - Validate price from main oracle against fallback oracle if the second validation failed\\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\\n * main oracle price is returned.\\n * @param vToken vToken address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n\\n address asset = _getUnderlyingAsset(vToken);\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Gets price of the asset\\n * @param asset asset address\\n * @return price USD price in scaled decimal places.\\n * @custom:error Paused error is thrown when resilent oracle is paused\\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\\n */\\n function getPrice(address asset) external view override returns (uint256) {\\n if (paused()) revert(\\\"resilient oracle is paused\\\");\\n return _getPrice(asset);\\n }\\n\\n /**\\n * @notice Sets/resets single token configs.\\n * @dev main oracle **must not** be a null address\\n * @param tokenConfig Token config struct\\n * @custom:access Only Governance\\n * @custom:error NotNullAddress is thrown if asset address is null\\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\\n */\\n function setTokenConfig(\\n TokenConfig memory tokenConfig\\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\\n _checkAccessAllowed(\\\"setTokenConfig(TokenConfig)\\\");\\n\\n tokenConfigs[tokenConfig.asset] = tokenConfig;\\n emit TokenConfigAdded(\\n tokenConfig.asset,\\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\\n );\\n }\\n\\n /**\\n * @notice Gets oracle and enabled status by asset address\\n * @param asset asset address\\n * @param role Oracle role\\n * @return oracle Oracle address based on role\\n * @return enabled Enabled flag of the oracle based on token config\\n */\\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\\n oracle = tokenConfigs[asset].oracles[uint256(role)];\\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\\n }\\n\\n function _getPrice(address asset) internal view returns (uint256) {\\n uint256 pivotPrice = INVALID_PRICE;\\n\\n // Get pivot oracle price, Invalid price if not available or error\\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\\n if (pivotOracleEnabled && pivotOracle != address(0)) {\\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\\n pivotPrice = pricePivot;\\n } catch {}\\n }\\n\\n // Compare main price and pivot price, return main price and if validation was successful\\n // note: In case pivot oracle is not available but main price is available and\\n // validation is successful, the main oracle price is returned.\\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\\n asset,\\n pivotPrice,\\n pivotOracleEnabled && pivotOracle != address(0)\\n );\\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\\n\\n // Compare fallback and pivot if main oracle comparision fails with pivot\\n // Return fallback price when fallback price is validated successfully with pivot oracle\\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\\n\\n // Lastly compare main price and fallback price\\n if (\\n mainPrice != INVALID_PRICE &&\\n fallbackPrice != INVALID_PRICE &&\\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\\n ) {\\n return mainPrice;\\n }\\n\\n revert(\\\"invalid resilient oracle price\\\");\\n }\\n\\n /**\\n * @notice Gets a price for the provided asset\\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\\n * able to fetch a correct price\\n * @param asset asset address\\n * @param pivotPrice Pivot oracle price\\n * @param pivotEnabled If pivot oracle is not empty and enabled\\n * @return price USD price in scaled decimals\\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\\n * @return pivotValidated Boolean representing if the validation of main oracle price\\n * and pivot oracle price were successful\\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\\n * address is null\\n */\\n function _getMainOraclePrice(\\n address asset,\\n uint256 pivotPrice,\\n bool pivotEnabled\\n ) internal view returns (uint256, bool) {\\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\\n if (mainOracleEnabled && mainOracle != address(0)) {\\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\\n if (!pivotEnabled) {\\n return (mainOraclePrice, true);\\n }\\n if (pivotPrice == INVALID_PRICE) {\\n return (mainOraclePrice, false);\\n }\\n return (\\n mainOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\\n * @param asset asset address\\n * @return price USD price in 18 decimals\\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\\n * and pivot oracle price were successfull\\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\\n * address is null\\n */\\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\\n if (fallbackEnabled && fallbackOracle != address(0)) {\\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\\n if (pivotPrice == INVALID_PRICE) {\\n return (fallbackOraclePrice, false);\\n }\\n return (\\n fallbackOraclePrice,\\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\\n );\\n } catch {\\n return (INVALID_PRICE, false);\\n }\\n }\\n\\n return (INVALID_PRICE, false);\\n }\\n\\n /**\\n * @dev This function returns the underlying asset of a vToken\\n * @param vToken vToken address\\n * @return asset underlying asset address\\n */\\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\\n if (vToken == nativeMarket) {\\n asset = NATIVE_TOKEN_ADDR;\\n } else if (vToken == vai) {\\n asset = vai;\\n } else {\\n asset = VBep20Interface(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x005e52885b8f7935dbccb1c87847229a9a2bfb66fd75fe200c9ec6f8a5d7a0e9\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface OracleInterface {\\n function getPrice(address asset) external view returns (uint256);\\n}\\n\\ninterface ResilientOracleInterface is OracleInterface {\\n function updatePrice(address vToken) external;\\n\\n function updateAssetPrice(address asset) external;\\n\\n function getUnderlyingPrice(address vToken) external view returns (uint256);\\n}\\n\\ninterface TwapInterface is OracleInterface {\\n function updateTwap(address asset) external returns (uint256);\\n}\\n\\ninterface BoundValidatorInterface {\\n function validatePriceWithAnchorPrice(\\n address asset,\\n uint256 reporterPrice,\\n uint256 anchorPrice\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x2432799b0d824fc701beb4c30146e912b9aeecf77b5c1635dde6c5fbe6bfc3a7\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\n\\ninterface VBep20Interface is IERC20Metadata {\\n /**\\n * @notice Underlying asset for this VToken\\n */\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x6e71c3df86501df5c0e4bace1333c0c91f9f9cced252a54fb99eeda219b789d5\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/**\\n * @title MaxLoopsLimitHelper\\n * @author Venus\\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\\n */\\nabstract contract MaxLoopsLimitHelper {\\n // Limit for the loops to avoid the DOS\\n uint256 public maxLoopsLimit;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when max loops limit is set\\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\\n\\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\\n\\n /**\\n * @notice Set the limit for the loops can iterate to avoid the DOS\\n * @param limit Limit for the max loops can execute at a time\\n */\\n function _setMaxLoopsLimit(uint256 limit) internal {\\n require(limit > maxLoopsLimit, \\\"Comptroller: Invalid maxLoopsLimit\\\");\\n\\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\\n maxLoopsLimit = limit;\\n\\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\\n }\\n\\n /**\\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\\n * @param len Length of the loops iterate\\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\\n */\\n function _ensureMaxLoops(uint256 len) internal view {\\n if (len > maxLoopsLimit) {\\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4c25e30635485d162177effa384eee51768b0141a567a0da16ff6ad673274166\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { IAbstractTokenConverter } from \\\"../TokenConverter/IAbstractTokenConverter.sol\\\";\\n\\n/**\\n * @title IConverterNetwork\\n * @author Venus\\n * @notice Interface implemented by `ConverterNetwork`.\\n */\\ninterface IConverterNetwork {\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance);\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\\n\\n /// @notice This function checks for given address is converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return boolean true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xd9a747f176d9b9de220331b87ed711cc2bd594a118b538a35f3c47060bff7a8b\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/ConverterNetwork.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { MaxLoopsLimitHelper } from \\\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { sort } from \\\"../Utils/ArrayHelpers.sol\\\";\\nimport { IAbstractTokenConverter } from \\\"./IAbstractTokenConverter.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @title ConverterNetwork\\n/// @author Venus\\n/// @notice ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ncontract ConverterNetwork is IConverterNetwork, AccessControlledV8, MaxLoopsLimitHelper {\\n /// @notice Array holding all the converters\\n IAbstractTokenConverter[] public allConverters;\\n\\n /// @notice Emitted when new converter is added\\n event ConverterAdded(address indexed converter);\\n\\n /// @notice Emitted when converter is removed\\n event ConverterRemoved(address indexed converter);\\n\\n /// @notice Error thrown when converter already exists\\n error ConverterAlreadyExists();\\n\\n /// @notice Error thrown converter does not exist\\n error ConverterDoesNotExist();\\n\\n /// @notice Error thrown when converter address is invalid\\n error InvalidTokenConverterAddress();\\n\\n /// @notice Error thrown when loops limit is invalid\\n error InvalidMaxLoopsLimit(uint256 loopsLimit);\\n\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor() {\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /// @notice ConverterNetwork initializer\\n /// @param _accessControlManager The address of ACM contract\\n /// @param _loopsLimit Limit for the loops in the contract to avoid DOS\\n /// @custom:event ConverterAdded is emitted for each converter added on success\\n /// @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\\n ensureNonzeroAddress(_accessControlManager);\\n __AccessControlled_init(_accessControlManager);\\n\\n if (_loopsLimit >= type(uint128).max) revert InvalidMaxLoopsLimit(_loopsLimit);\\n _setMaxLoopsLimit(_loopsLimit);\\n }\\n\\n /**\\n * @notice Set the limit for the loops can iterate to avoid the DOS\\n * @param limit Limit for the max loops can execute at a time\\n * @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\\n * @custom:access Only owner\\n */\\n function setMaxLoopsLimit(uint256 limit) external onlyOwner {\\n if (limit >= type(uint128).max) revert InvalidMaxLoopsLimit(limit);\\n _setMaxLoopsLimit(limit);\\n }\\n\\n /// @notice Adds new converter to the array\\n /// @param _tokenConverter Address of the token converter\\n /// @custom:event ConverterAdded is emitted on success\\n /// @custom:access Only Governance\\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external {\\n _checkAccessAllowed(\\\"addTokenConverter(address)\\\");\\n _addTokenConverter(_tokenConverter);\\n }\\n\\n /// @notice Removes converter from the array\\n /// @param _tokenConverter Address of the token converter\\n /// @custom:error ConverterDoesNotExist is thrown when converter to remove does not exist\\n /// @custom:event ConverterRemoved is emitted on success\\n /// @custom:access Only Governance\\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external {\\n _checkAccessAllowed(\\\"removeTokenConverter(address)\\\");\\n\\n // Find the index of the converter in the array\\n uint128 indexToRemove = _findConverterIndex(_tokenConverter);\\n\\n // Ensure that the converter exists in the array\\n if (indexToRemove == type(uint128).max) revert ConverterDoesNotExist();\\n\\n // Swap the element to remove with the last element\\n allConverters[indexToRemove] = allConverters[allConverters.length - 1];\\n\\n // Remove the last element (which is now a duplicate)\\n allConverters.pop();\\n\\n emit ConverterRemoved(address(_tokenConverter));\\n }\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// It will return the converters which are open to users for conversion\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance)\\n {\\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, false);\\n }\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// It will return the converters which are open to converters for conversion.\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @return converters Array of the conveters on the basis of the tokens pair\\n /// @return convertersBalance Array of balances with respect to token out\\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\\n external\\n returns (address[] memory converters, uint256[] memory convertersBalance)\\n {\\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, true);\\n }\\n\\n /// @notice This function returns the array containing all the converters addresses\\n /// @return converters Array containing all the converters addresses\\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory converters) {\\n converters = allConverters;\\n }\\n\\n /// @notice This function checks if the given address is a converter or not\\n /// @param _tokenConverter Address of the token converter\\n /// @return isConverter true if given address is converter otherwise false\\n function isTokenConverter(address _tokenConverter) external view returns (bool isConverter) {\\n uint128 index = _findConverterIndex(IAbstractTokenConverter(_tokenConverter));\\n\\n if (index != type(uint128).max) {\\n isConverter = true;\\n }\\n }\\n\\n /// @notice Adds new converter contract to the array\\n /// @param _tokenConverter Address of the token converter\\n /// @custom:error ConverterAlreadyExists is thrown when new tokenconverter to add already exists\\n /// @custom:event ConverterAdded is emitted on success\\n function _addTokenConverter(IAbstractTokenConverter _tokenConverter) internal {\\n if (\\n (address(_tokenConverter) == address(0)) || (address(_tokenConverter.converterNetwork()) != address(this))\\n ) {\\n revert InvalidTokenConverterAddress();\\n }\\n\\n uint128 index = _findConverterIndex(_tokenConverter);\\n if (index != type(uint128).max) revert ConverterAlreadyExists();\\n\\n allConverters.push(_tokenConverter);\\n _ensureMaxLoops(allConverters.length);\\n\\n emit ConverterAdded(address(_tokenConverter));\\n }\\n\\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\\n /// @param _tokenAddressIn Address of tokenIn\\n /// @param _tokenAddressOut Address of tokenOut\\n /// @param forConverters Bool to filter out converters on the basis of the conversionAccess\\n /// @return converters Array of converters\\n /// @return convertersBalance Array of balances with respect to token out\\n function _findTokenConverters(\\n address _tokenAddressIn,\\n address _tokenAddressOut,\\n bool forConverters\\n ) internal returns (address[] memory converters, uint256[] memory convertersBalance) {\\n uint128 convertersLength = uint128(allConverters.length);\\n\\n // Create a dynamic array to store the matching converters\\n converters = new address[](convertersLength);\\n convertersBalance = new uint256[](convertersLength);\\n uint128 count;\\n\\n for (uint128 i; i < convertersLength; ) {\\n IAbstractTokenConverter converter = allConverters[i];\\n\\n unchecked {\\n ++i;\\n }\\n\\n if ((address(converter.converterNetwork()) != address(this)) || msg.sender == address(converter)) {\\n continue;\\n }\\n\\n (, IAbstractTokenConverter.ConversionAccessibility conversionAccess) = converter.conversionConfigurations(\\n _tokenAddressIn,\\n _tokenAddressOut\\n );\\n\\n if (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ALL) {\\n converters[count] = address(converter);\\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\\n ++count;\\n } else if (\\n forConverters &&\\n (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_CONVERTERS)\\n ) {\\n converters[count] = address(converter);\\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\\n ++count;\\n } else if (\\n !forConverters && (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_USERS)\\n ) {\\n converters[count] = address(converter);\\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\\n ++count;\\n }\\n }\\n\\n // Resize the array to the actual number of matching converters\\n assembly {\\n mstore(converters, count)\\n mstore(convertersBalance, count)\\n }\\n sort(convertersBalance, converters);\\n }\\n\\n /// @notice Used to get the index of the converter stored in the array\\n /// This will return the index if the converter exists in the array otherwise will return type(uint128).max\\n /// @param _tokenConverter Address of the token converter\\n /// @return index of the converter address in the allConverters array\\n function _findConverterIndex(IAbstractTokenConverter _tokenConverter) internal view returns (uint128 index) {\\n index = type(uint128).max; // Not found, return a large value\\n\\n uint128 convertersLength = uint128(allConverters.length);\\n for (uint128 i; i < convertersLength; ) {\\n if (allConverters[i] == _tokenConverter) {\\n index = i;\\n }\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe9fdf8e3af51249c162e37c946b8966f4b9ccec719201c8fd4258cb89c6d294\",\"license\":\"BSD-3-Clause\"},\"contracts/TokenConverter/IAbstractTokenConverter.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport { ResilientOracle } from \\\"@venusprotocol/oracle/contracts/ResilientOracle.sol\\\";\\nimport { IConverterNetwork } from \\\"../Interfaces/IConverterNetwork.sol\\\";\\n\\n/// @notice Interface for AbstractTokenConverter\\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\\ninterface IAbstractTokenConverter {\\n /// @notice This enum define the all possible ways of conversion can happen\\n enum ConversionAccessibility {\\n NONE, // Conversion is disable for the pair\\n ALL, // Conversion is enable for private conversion and users\\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\\n ONLY_FOR_USERS // Conversion is enable only for users\\n }\\n\\n /// @notice This struct represents the configuration for a token conversion.\\n struct ConversionConfig {\\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\\n uint256 incentive;\\n /// enable or disable conversion for users or converters or both or none\\n ConversionAccessibility conversionAccess;\\n }\\n\\n /// @notice Pause conversion of tokens\\n function pauseConversion() external;\\n\\n /// @notice Resume conversion of tokens.\\n function resumeConversion() external;\\n\\n /// @notice Sets a new price oracle\\n /// @param priceOracle_ Address of the new price oracle to set\\n function setPriceOracle(ResilientOracle priceOracle_) external;\\n\\n /// @notice Set the configuration for new or existing convert pair\\n /// @param tokenAddressIn Address of tokenIn\\n /// @param tokenAddressOut Address of tokenOut\\n /// @param conversionConfig ConversionConfig config details to update\\n function setConversionConfig(\\n address tokenAddressIn,\\n address tokenAddressOut,\\n ConversionConfig calldata conversionConfig\\n ) external;\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @dev Method does not support deflationary tokens transfer\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMantissa,\\n uint256 amountOutMinMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after convert\\n /// @param to Address of the tokenAddressOut receiver\\n function convertForExactTokensSupportingFeeOnTransferTokens(\\n uint256 amountInMaxMantissa,\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut,\\n address to\\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\\n\\n /// @notice Get the configuration for the pair of the tokens\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\\n /// @return conversionAccess Accessibility for the pair of tokens\\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\\n external\\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\\n\\n /// @notice Get the address of the converterNetwork\\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getUpdatedAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountIn(\\n uint256 amountOutMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\\n\\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\\n /// @dev This function retrieves values without altering token prices.\\n /// @param amountInMantissa Amount of tokenAddressIn\\n /// @param tokenAddressIn Address of the token to convert\\n /// @param tokenAddressOut Address of the token to get after conversion\\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\\n function getAmountOut(\\n uint256 amountInMantissa,\\n address tokenAddressIn,\\n address tokenAddressOut\\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\\n\\n /// @notice Get the balance for specific token\\n /// @param token Address of the token\\n /// @return tokenBalance Balance of the token the contract has\\n function balanceOf(address token) external view returns (uint256 tokenBalance);\\n}\\n\",\"keccak256\":\"0x7852d4f8a6dd1c80d14342f8ff2e26f723eb00c888e9a9e50a5fe8f95c59200c\",\"license\":\"BSD-3-Clause\"},\"contracts/Utils/ArrayHelpers.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Used to sort addresses array based on their token balances\\n/// @param arr Array of token balances of different addresses\\n/// @param addrs Array containing these addresses\\nfunction sort(uint256[] memory arr, address[] memory addrs) pure {\\n if (arr.length > 1) {\\n return quickSortDescending(arr, addrs, 0, arr.length - 1);\\n }\\n}\\n\\n/// @notice Used to sort addresses array based on their token balances\\n/// @param arr Array of token balances of different addresses\\n/// @param addrs Array containing these addresses\\n/// @param left index of first value\\n/// @param right index of last value\\nfunction quickSortDescending(\\n uint256[] memory arr,\\n address[] memory addrs,\\n uint256 left,\\n uint256 right\\n) pure {\\n if (left >= right) return;\\n uint256 p = arr[(left + right) / 2]; // p = the pivot element\\n uint256 i = left;\\n uint256 j = right;\\n while (i < j) {\\n while (arr[i] > p) ++i;\\n while (arr[j] < p) --j; // arr[j] < p means p still to the right, so j > 0\\n if (arr[i] < arr[j]) {\\n (arr[i], arr[j]) = (arr[j], arr[i]);\\n (addrs[i], addrs[j]) = (addrs[j], addrs[i]);\\n } else {\\n ++i;\\n }\\n }\\n\\n if (j > left) quickSortDescending(arr, addrs, left, j - 1); // j > left, so j > 0\\n quickSortDescending(arr, addrs, j + 1, right);\\n}\\n\",\"keccak256\":\"0xc52f21116bbc94532e4022f72980d2605f8ec7580a82d87aaaebf893ba03c2f7\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x6080604052348015600f57600080fd5b506016601a565b60d7565b600054610100900460ff161560855760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161460d5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6120ae806100e66000396000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c806380d45a2d116100b2578063be26317e11610081578063e30c397811610066578063e30c39781461027e578063f2fde38b1461029c578063f49e746f146102af57600080fd5b8063be26317e14610254578063cd6dc6871461026b57600080fd5b806380d45a2d146101f25780638da5cb5b14610205578063932fd98514610223578063b4a0bdf31461023657600080fd5b80634e9f8f39116100ee5780634e9f8f39146101ac5780636c059fb1146101bf578063715018a6146101e257806379ba5097146101ea57600080fd5b80630e32cb861461012057806325a31b6b14610135578063285510e9146101535780633119e7c71461018b575b600080fd5b61013361012e366004611b9f565b6102c2565b005b61013d6102d6565b60405161014a9190611bc3565b60405180910390f35b610166610161366004611c1d565b610345565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014a565b61019e610199366004611c36565b61037c565b60405161014a929190611c6f565b61019e6101ba366004611c36565b610396565b6101d26101cd366004611b9f565b6103a5565b604051901515815260200161014a565b6101336103d7565b6101336103eb565b610133610200366004611c1d565b6104a2565b60335473ffffffffffffffffffffffffffffffffffffffff16610166565b610133610231366004611b9f565b6104ff565b60975473ffffffffffffffffffffffffffffffffffffffff16610166565b61025d60c95481565b60405190815260200161014a565b610133610279366004611d00565b610546565b60655473ffffffffffffffffffffffffffffffffffffffff16610166565b6101336102aa366004611b9f565b610739565b6101336102bd366004611b9f565b6107e9565b6102ca610a00565b6102d381610a81565b50565b606060fb80548060200260200160405190810160405280929190818152602001828054801561033b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610310575b5050505050905090565b60fb818154811061035557600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60608061038b84846000610bab565b909590945092505050565b60608061038b84846001610bab565b6000806103b183611100565b90506fffffffffffffffffffffffffffffffff808216146103d157600191505b50919050565b6103df610a00565b6103e960006111ba565b565b606554339073ffffffffffffffffffffffffffffffffffffffff168114610499576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102d3816111ba565b6104aa610a00565b6fffffffffffffffffffffffffffffffff81106104f6576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101829052602401610490565b6102d3816111eb565b61053d6040518060400160405280601a81526020017f616464546f6b656e436f6e7665727465722861646472657373290000000000008152506112ba565b6102d381611397565b600054610100900460ff16158080156105665750600054600160ff909116105b806105805750303b158015610580575060005460ff166001145b61060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610490565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561066a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610673836115a3565b61067c836115f0565b6fffffffffffffffffffffffffffffffff82106106c8576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101839052602401610490565b6106d1826111eb565b801561073457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610741610a00565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556107a460335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6108276040518060400160405280601d81526020017f72656d6f7665546f6b656e436f6e7665727465722861646472657373290000008152506112ba565b600061083282611100565b90507fffffffffffffffffffffffffffffffff000000000000000000000000000000016fffffffffffffffffffffffffffffffff82160161089f576040517f2516fa2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb80546108af90600190611d5b565b815481106108bf576108bf611d74565b60009182526020909120015460fb805473ffffffffffffffffffffffffffffffffffffffff909216916fffffffffffffffffffffffffffffffff841690811061090a5761090a611d74565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060fb80548061096357610963611da3565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917febba5edf297d79cea0ec18d97adacf578cc3152240bd112e8d7da26ba65700d191a25050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146103e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8116610b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610490565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b60fb5460609081906fffffffffffffffffffffffffffffffff811667ffffffffffffffff811115610bde57610bde611dd2565b604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509250806fffffffffffffffffffffffffffffffff1667ffffffffffffffff811115610c3557610c35611dd2565b604051908082528060200260200182016040528015610c5e578160200160208202803683370190505b5091506000805b826fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156110e557600060fb826fffffffffffffffffffffffffffffffff1681548110610cb857610cb8611d74565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160010191503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d739190611e01565b73ffffffffffffffffffffffffffffffffffffffff16141580610dab57503373ffffffffffffffffffffffffffffffffffffffff8216145b15610db65750610c65565b6040517fb491ddf700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015289811660248301526000919083169063b491ddf79060440160408051808303816000875af1158015610e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e539190611e1e565b915060019050816003811115610e6b57610e6b611e47565b03610f73578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f349190611e76565b86856fffffffffffffffffffffffffffffffff1681518110610f5857610f58611d74565b6020908102919091010152610f6c84611e8f565b93506110de565b878015610f9157506002816003811115610f8f57610f8f611e47565b145b15610fbb578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b87158015610fda57506003816003811115610fd857610fd8611e47565b145b156110de578187856fffffffffffffffffffffffffffffffff168151811061100457611004611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa15801561107f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a39190611e76565b86856fffffffffffffffffffffffffffffffff16815181106110c7576110c7611d74565b60209081029190910101526110db84611e8f565b93505b5050610c65565b508084528083526110f68385611698565b5050935093915050565b60fb546fffffffffffffffffffffffffffffffff9060005b816fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156111b3578373ffffffffffffffffffffffffffffffffffffffff1660fb826fffffffffffffffffffffffffffffffff168154811061118057611180611d74565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16036111ab578092505b600101611118565b5050919050565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556102d3816116bc565b60c954811161127c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610490565b60c980549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101610b9f565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906113139033908690600401611f22565b602060405180830381865afa158015611330573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113549190611f59565b905080611393573330836040517f4a3fa29300000000000000000000000000000000000000000000000000000000815260040161049093929190611f7b565b5050565b73ffffffffffffffffffffffffffffffffffffffff8116158061145657503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190611e01565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561148d576040517f36e7473200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061149882611100565b90506fffffffffffffffffffffffffffffffff808216146114e5576040517f0aef5e8600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb805460018101825560008290527f3e7257b7272bb46d49cd6019b04ddee20da7c0cb13f7c1ec3391291b2ccebabc0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555461155e90611733565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fa0a158044a2552256f6415ce60c2ef0d6983a67f58e491cd7af6e48ae2abe25f90600090a25050565b73ffffffffffffffffffffffffffffffffffffffff81166102d3576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054610100900460ff16611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b61168f61177d565b6102d38161181c565b6001825111156113935761139382826000600186516116b79190611d5b565b6118b3565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c9548111156102d35760c9546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610490565b600054610100900460ff16611814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9611add565b600054610100900460ff166102ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b80821015611ad75760008460026118ca8486611fbd565b6118d49190611fd0565b815181106118e4576118e4611d74565b6020908102919091010151905082825b80821015611aa4575b8287838151811061191057611910611d74565b6020026020010151111561192e576119278261200b565b91506118fd565b8287828151811061194157611941611d74565b6020026020010151101561195f5761195881612043565b905061192e565b86818151811061197157611971611d74565b602002602001015187838151811061198b5761198b611d74565b60200260200101511015611a94578681815181106119ab576119ab611d74565b60200260200101518783815181106119c5576119c5611d74565b60200260200101518884815181106119df576119df611d74565b602002602001018984815181106119f8576119f8611d74565b6020026020010182815250828152505050858181518110611a1b57611a1b611d74565b6020026020010151868381518110611a3557611a35611d74565b6020026020010151878481518110611a4f57611a4f611d74565b60200260200101888481518110611a6857611a68611d74565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690526118f4565b611a9d8261200b565b91506118f4565b84811115611abd57611abd8787876116b7600186611d5b565b611ad38787611acd846001611fbd565b876118b3565b5050505b50505050565b600054610100900460ff16611b74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9336111ba565b73ffffffffffffffffffffffffffffffffffffffff811681146102d357600080fd5b600060208284031215611bb157600080fd5b8135611bbc81611b7d565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015611c1157835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611bdf565b50909695505050505050565b600060208284031215611c2f57600080fd5b5035919050565b60008060408385031215611c4957600080fd5b8235611c5481611b7d565b91506020830135611c6481611b7d565b809150509250929050565b604080825283519082018190526000906020906060840190828701845b82811015611cbe57815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101611c8c565b5050508381038285015284518082528583019183019060005b81811015611cf357835183529284019291840191600101611cd7565b5090979650505050505050565b60008060408385031215611d1357600080fd5b8235611d1e81611b7d565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115611d6e57611d6e611d2c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215611e1357600080fd5b8151611bbc81611b7d565b60008060408385031215611e3157600080fd5b82519150602083015160048110611c6457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600060208284031215611e8857600080fd5b5051919050565b60006fffffffffffffffffffffffffffffffff808316818103611eb457611eb4611d2c565b6001019392505050565b6000815180845260005b81811015611ee457602081850181015186830182015201611ec8565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611f516040830184611ebe565b949350505050565b600060208284031215611f6b57600080fd5b81518015158114611bbc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808616835280851660208401525060606040830152611fb46060830184611ebe565b95945050505050565b80820180821115611d6e57611d6e611d2c565b600082612006577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361203c5761203c611d2c565b5060010190565b60008161205257612052611d2c565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea264697066735822122043fe620950a480d860f29545b04e4166e48b1a7cedd58d8784b99cbba91f803b64736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061011b5760003560e01c806380d45a2d116100b2578063be26317e11610081578063e30c397811610066578063e30c39781461027e578063f2fde38b1461029c578063f49e746f146102af57600080fd5b8063be26317e14610254578063cd6dc6871461026b57600080fd5b806380d45a2d146101f25780638da5cb5b14610205578063932fd98514610223578063b4a0bdf31461023657600080fd5b80634e9f8f39116100ee5780634e9f8f39146101ac5780636c059fb1146101bf578063715018a6146101e257806379ba5097146101ea57600080fd5b80630e32cb861461012057806325a31b6b14610135578063285510e9146101535780633119e7c71461018b575b600080fd5b61013361012e366004611b9f565b6102c2565b005b61013d6102d6565b60405161014a9190611bc3565b60405180910390f35b610166610161366004611c1d565b610345565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014a565b61019e610199366004611c36565b61037c565b60405161014a929190611c6f565b61019e6101ba366004611c36565b610396565b6101d26101cd366004611b9f565b6103a5565b604051901515815260200161014a565b6101336103d7565b6101336103eb565b610133610200366004611c1d565b6104a2565b60335473ffffffffffffffffffffffffffffffffffffffff16610166565b610133610231366004611b9f565b6104ff565b60975473ffffffffffffffffffffffffffffffffffffffff16610166565b61025d60c95481565b60405190815260200161014a565b610133610279366004611d00565b610546565b60655473ffffffffffffffffffffffffffffffffffffffff16610166565b6101336102aa366004611b9f565b610739565b6101336102bd366004611b9f565b6107e9565b6102ca610a00565b6102d381610a81565b50565b606060fb80548060200260200160405190810160405280929190818152602001828054801561033b57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610310575b5050505050905090565b60fb818154811061035557600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60608061038b84846000610bab565b909590945092505050565b60608061038b84846001610bab565b6000806103b183611100565b90506fffffffffffffffffffffffffffffffff808216146103d157600191505b50919050565b6103df610a00565b6103e960006111ba565b565b606554339073ffffffffffffffffffffffffffffffffffffffff168114610499576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6102d3816111ba565b6104aa610a00565b6fffffffffffffffffffffffffffffffff81106104f6576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101829052602401610490565b6102d3816111eb565b61053d6040518060400160405280601a81526020017f616464546f6b656e436f6e7665727465722861646472657373290000000000008152506112ba565b6102d381611397565b600054610100900460ff16158080156105665750600054600160ff909116105b806105805750303b158015610580575060005460ff166001145b61060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610490565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561066a57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610673836115a3565b61067c836115f0565b6fffffffffffffffffffffffffffffffff82106106c8576040517f132515e000000000000000000000000000000000000000000000000000000000815260048101839052602401610490565b6106d1826111eb565b801561073457600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050565b610741610a00565b6065805473ffffffffffffffffffffffffffffffffffffffff83167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556107a460335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6108276040518060400160405280601d81526020017f72656d6f7665546f6b656e436f6e7665727465722861646472657373290000008152506112ba565b600061083282611100565b90507fffffffffffffffffffffffffffffffff000000000000000000000000000000016fffffffffffffffffffffffffffffffff82160161089f576040517f2516fa2900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb80546108af90600190611d5b565b815481106108bf576108bf611d74565b60009182526020909120015460fb805473ffffffffffffffffffffffffffffffffffffffff909216916fffffffffffffffffffffffffffffffff841690811061090a5761090a611d74565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060fb80548061096357610963611da3565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917febba5edf297d79cea0ec18d97adacf578cc3152240bd112e8d7da26ba65700d191a25050565b60335473ffffffffffffffffffffffffffffffffffffffff1633146103e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610490565b73ffffffffffffffffffffffffffffffffffffffff8116610b24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610490565b6097805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b60fb5460609081906fffffffffffffffffffffffffffffffff811667ffffffffffffffff811115610bde57610bde611dd2565b604051908082528060200260200182016040528015610c07578160200160208202803683370190505b509250806fffffffffffffffffffffffffffffffff1667ffffffffffffffff811115610c3557610c35611dd2565b604051908082528060200260200182016040528015610c5e578160200160208202803683370190505b5091506000805b826fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156110e557600060fb826fffffffffffffffffffffffffffffffff1681548110610cb857610cb8611d74565b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160010191503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d739190611e01565b73ffffffffffffffffffffffffffffffffffffffff16141580610dab57503373ffffffffffffffffffffffffffffffffffffffff8216145b15610db65750610c65565b6040517fb491ddf700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a8116600483015289811660248301526000919083169063b491ddf79060440160408051808303816000875af1158015610e2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e539190611e1e565b915060019050816003811115610e6b57610e6b611e47565b03610f73578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f349190611e76565b86856fffffffffffffffffffffffffffffffff1681518110610f5857610f58611d74565b6020908102919091010152610f6c84611e8f565b93506110de565b878015610f9157506002816003811115610f8f57610f8f611e47565b145b15610fbb578187856fffffffffffffffffffffffffffffffff1681518110610e9557610e95611d74565b87158015610fda57506003816003811115610fd857610fd8611e47565b145b156110de578187856fffffffffffffffffffffffffffffffff168151811061100457611004611d74565b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526040517f70a082310000000000000000000000000000000000000000000000000000000081528a82166004820152908316906370a0823190602401602060405180830381865afa15801561107f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a39190611e76565b86856fffffffffffffffffffffffffffffffff16815181106110c7576110c7611d74565b60209081029190910101526110db84611e8f565b93505b5050610c65565b508084528083526110f68385611698565b5050935093915050565b60fb546fffffffffffffffffffffffffffffffff9060005b816fffffffffffffffffffffffffffffffff16816fffffffffffffffffffffffffffffffff1610156111b3578373ffffffffffffffffffffffffffffffffffffffff1660fb826fffffffffffffffffffffffffffffffff168154811061118057611180611d74565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16036111ab578092505b600101611118565b5050919050565b606580547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556102d3816116bc565b60c954811161127c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610490565b60c980549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101610b9f565b6097546040517f18c5e8ab00000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906318c5e8ab906113139033908690600401611f22565b602060405180830381865afa158015611330573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113549190611f59565b905080611393573330836040517f4a3fa29300000000000000000000000000000000000000000000000000000000815260040161049093929190611f7b565b5050565b73ffffffffffffffffffffffffffffffffffffffff8116158061145657503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff166301e201786040518163ffffffff1660e01b81526004016020604051808303816000875af1158015611419573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143d9190611e01565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561148d576040517f36e7473200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061149882611100565b90506fffffffffffffffffffffffffffffffff808216146114e5576040517f0aef5e8600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60fb805460018101825560008290527f3e7257b7272bb46d49cd6019b04ddee20da7c0cb13f7c1ec3391291b2ccebabc0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555461155e90611733565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fa0a158044a2552256f6415ce60c2ef0d6983a67f58e491cd7af6e48ae2abe25f90600090a25050565b73ffffffffffffffffffffffffffffffffffffffff81166102d3576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054610100900460ff16611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b61168f61177d565b6102d38161181c565b6001825111156113935761139382826000600186516116b79190611d5b565b6118b3565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60c9548111156102d35760c9546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610490565b600054610100900460ff16611814576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9611add565b600054610100900460ff166102ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b80821015611ad75760008460026118ca8486611fbd565b6118d49190611fd0565b815181106118e4576118e4611d74565b6020908102919091010151905082825b80821015611aa4575b8287838151811061191057611910611d74565b6020026020010151111561192e576119278261200b565b91506118fd565b8287828151811061194157611941611d74565b6020026020010151101561195f5761195881612043565b905061192e565b86818151811061197157611971611d74565b602002602001015187838151811061198b5761198b611d74565b60200260200101511015611a94578681815181106119ab576119ab611d74565b60200260200101518783815181106119c5576119c5611d74565b60200260200101518884815181106119df576119df611d74565b602002602001018984815181106119f8576119f8611d74565b6020026020010182815250828152505050858181518110611a1b57611a1b611d74565b6020026020010151868381518110611a3557611a35611d74565b6020026020010151878481518110611a4f57611a4f611d74565b60200260200101888481518110611a6857611a68611d74565b73ffffffffffffffffffffffffffffffffffffffff9384166020918202929092010152911690526118f4565b611a9d8261200b565b91506118f4565b84811115611abd57611abd8787876116b7600186611d5b565b611ad38787611acd846001611fbd565b876118b3565b5050505b50505050565b600054610100900460ff16611b74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610490565b6103e9336111ba565b73ffffffffffffffffffffffffffffffffffffffff811681146102d357600080fd5b600060208284031215611bb157600080fd5b8135611bbc81611b7d565b9392505050565b6020808252825182820181905260009190848201906040850190845b81811015611c1157835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101611bdf565b50909695505050505050565b600060208284031215611c2f57600080fd5b5035919050565b60008060408385031215611c4957600080fd5b8235611c5481611b7d565b91506020830135611c6481611b7d565b809150509250929050565b604080825283519082018190526000906020906060840190828701845b82811015611cbe57815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101611c8c565b5050508381038285015284518082528583019183019060005b81811015611cf357835183529284019291840191600101611cd7565b5090979650505050505050565b60008060408385031215611d1357600080fd5b8235611d1e81611b7d565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115611d6e57611d6e611d2c565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215611e1357600080fd5b8151611bbc81611b7d565b60008060408385031215611e3157600080fd5b82519150602083015160048110611c6457600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600060208284031215611e8857600080fd5b5051919050565b60006fffffffffffffffffffffffffffffffff808316818103611eb457611eb4611d2c565b6001019392505050565b6000815180845260005b81811015611ee457602081850181015186830182015201611ec8565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b73ffffffffffffffffffffffffffffffffffffffff83168152604060208201526000611f516040830184611ebe565b949350505050565b600060208284031215611f6b57600080fd5b81518015158114611bbc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808616835280851660208401525060606040830152611fb46060830184611ebe565b95945050505050565b80820180821115611d6e57611d6e611d2c565b600082612006577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361203c5761203c611d2c565b5060010190565b60008161205257612052611d2c565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea264697066735822122043fe620950a480d860f29545b04e4166e48b1a7cedd58d8784b99cbba91f803b64736f6c63430008190033", + "devdoc": { + "author": "Venus", + "custom:security-contact": "https://github.com/VenusProtocol/protocol-reserve#discussion", + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "addTokenConverter(address)": { + "custom:access": "Only Governance", + "custom:event": "ConverterAdded is emitted on success", + "params": { + "_tokenConverter": "Address of the token converter" + } + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor" + }, + "findTokenConverters(address,address)": { + "params": { + "_tokenAddressIn": "Address of tokenIn", + "_tokenAddressOut": "Address of tokenOut" + }, + "returns": { + "converters": "Array of the conveters on the basis of the tokens pair", + "convertersBalance": "Array of balances with respect to token out" + } + }, + "findTokenConvertersForConverters(address,address)": { + "params": { + "_tokenAddressIn": "Address of tokenIn", + "_tokenAddressOut": "Address of tokenOut" + }, + "returns": { + "converters": "Array of the conveters on the basis of the tokens pair", + "convertersBalance": "Array of balances with respect to token out" + } + }, + "getAllConverters()": { + "returns": { + "converters": "Array containing all the converters addresses" + } + }, + "initialize(address,uint256)": { + "custom:error": "InvalidMaxLoopsLimit is thrown when when loops limit is invalid", + "custom:event": "ConverterAdded is emitted for each converter added on success", + "params": { + "_accessControlManager": "The address of ACM contract", + "_loopsLimit": "Limit for the loops in the contract to avoid DOS" + } + }, + "isTokenConverter(address)": { + "params": { + "_tokenConverter": "Address of the token converter" + }, + "returns": { + "isConverter": "true if given address is converter otherwise false" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "removeTokenConverter(address)": { + "custom:access": "Only Governance", + "custom:error": "ConverterDoesNotExist is thrown when converter to remove does not exist", + "custom:event": "ConverterRemoved is emitted on success", + "params": { + "_tokenConverter": "Address of the token converter" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setMaxLoopsLimit(uint256)": { + "custom:access": "Only owner", + "custom:error": "InvalidMaxLoopsLimit is thrown when when loops limit is invalid", + "params": { + "limit": "Limit for the max loops can execute at a time" + } + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + } + }, + "title": "ConverterNetwork", + "version": 1 + }, + "userdoc": { + "errors": { + "ConverterAlreadyExists()": [ + { + "notice": "Error thrown when converter already exists" + } + ], + "ConverterDoesNotExist()": [ + { + "notice": "Error thrown converter does not exist" + } + ], + "InvalidMaxLoopsLimit(uint256)": [ + { + "notice": "Error thrown when loops limit is invalid" + } + ], + "InvalidTokenConverterAddress()": [ + { + "notice": "Error thrown when converter address is invalid" + } + ], + "MaxLoopsLimitExceeded(uint256,uint256)": [ + { + "notice": "Thrown an error on maxLoopsLimit exceeds for any loop" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ] + }, + "events": { + "ConverterAdded(address)": { + "notice": "Emitted when new converter is added" + }, + "ConverterRemoved(address)": { + "notice": "Emitted when converter is removed" + }, + "MaxLoopsLimitUpdated(uint256,uint256)": { + "notice": "Emitted when max loops limit is set" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + } + }, + "kind": "user", + "methods": { + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "addTokenConverter(address)": { + "notice": "Adds new converter to the array" + }, + "allConverters(uint256)": { + "notice": "Array holding all the converters" + }, + "findTokenConverters(address,address)": { + "notice": "Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to users for conversion" + }, + "findTokenConvertersForConverters(address,address)": { + "notice": "Used to get the array of converters supporting conversions, arranged in descending order based on token balances It will return the converters which are open to converters for conversion." + }, + "getAllConverters()": { + "notice": "This function returns the array containing all the converters addresses" + }, + "initialize(address,uint256)": { + "notice": "ConverterNetwork initializer" + }, + "isTokenConverter(address)": { + "notice": "This function checks if the given address is a converter or not" + }, + "removeTokenConverter(address)": { + "notice": "Removes converter from the array" + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "setMaxLoopsLimit(uint256)": { + "notice": "Set the limit for the loops can iterate to avoid the DOS" + } + }, + "notice": "ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 6563, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "maxLoopsLimit", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 6568, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 12119, + "contract": "contracts/TokenConverter/ConverterNetwork.sol:ConverterNetwork", + "label": "allConverters", + "offset": 0, + "slot": "251", + "type": "t_array(t_contract(IAbstractTokenConverter)12892)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_contract(IAbstractTokenConverter)12892)dyn_storage": { + "base": "t_contract(IAbstractTokenConverter)12892", + "encoding": "dynamic_array", + "label": "contract IAbstractTokenConverter[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAbstractTokenConverter)12892": { + "encoding": "inplace", + "label": "contract IAbstractTokenConverter", + "numberOfBytes": "20" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/arbitrumone/ConverterNetwork_Proxy.json b/deployments/arbitrumone/ConverterNetwork_Proxy.json new file mode 100644 index 00000000..94ee514d --- /dev/null +++ b/deployments/arbitrumone/ConverterNetwork_Proxy.json @@ -0,0 +1,277 @@ +{ + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "receipt": { + "to": null, + "from": "0x2A94EAb15be8557e6dDAE87eCeCf69ba58aAE2AD", + "contractAddress": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "transactionIndex": 1, + "gasUsed": "2453945", + "logsBloom": "0x00000000000000040000000000000004400000000000000000800000000000000000000000000000000000000000000000000000000000000000040000008000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000010000000400000000000000000000000000000000000000000000080000002000000800000000000000000000000002000000400000000000000800000000000000000000000000020000000000000000001040000000000000400000000000400000020000000000200000000000000000000000000000800000000000000000000000000", + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d", + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "logs": [ + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000f4b78771044d21f8289238cad82ba5a13076aa4d" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000002a94eab15be8557e6ddae87ececf69ba58aae2ad" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b157", + "logIndex": 2, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 3, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 4, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + }, + { + "transactionIndex": 1, + "blockNumber": 276074336, + "transactionHash": "0xa0bacd284a8f854718c60fc06793e10a2578f259331680d8318aabbc37deafad", + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f6ff3e9459227f0cde8b102b90be25960317b216", + "logIndex": 5, + "blockHash": "0xf359ccc420a5dd5d83187bc9c1b999492d2b42c6477ae63cf577d615dc90ed1d" + } + ], + "blockNumber": 276074336, + "cumulativeGasUsed": "2453945", + "status": 1, + "byzantium": true + }, + "args": [ + "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", + "0xcd6dc687000000000000000000000000d9dd18eb0cf10cba837677f28a8f9bda4bc2b1570000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} From f0d55ad2ec076ebe45f2fe79c7ddeeb7784b5381 Mon Sep 17 00:00:00 2001 From: Debugger022 Date: Tue, 19 Nov 2024 15:10:15 +0000 Subject: [PATCH 14/24] feat: updating deployment files --- deployments/arbitrumone.json | 5825 ++++++++++++++++++++---- deployments/arbitrumone_addresses.json | 15 +- 2 files changed, 4950 insertions(+), 890 deletions(-) diff --git a/deployments/arbitrumone.json b/deployments/arbitrumone.json index b2f84558..5d339aab 100644 --- a/deployments/arbitrumone.json +++ b/deployments/arbitrumone.json @@ -2,173 +2,8 @@ "name": "arbitrumone", "chainId": "42161", "contracts": { - "DefaultProxyAdmin": { - "address": "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "initialOwner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeProxyAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - } - ], - "name": "getProxyImplementation", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "upgrade", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract TransparentUpgradeableProxy", - "name": "proxy", - "type": "address" - }, - { - "internalType": "address", - "name": "implementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - } - ] - }, - "ProtocolShareReserve": { - "address": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41", + "ConverterNetwork": { + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", "abi": [ { "anonymous": false, @@ -295,12 +130,28 @@ }, { "inputs": [], - "name": "InvalidAddress", + "name": "ConverterAlreadyExists", "type": "error" }, { "inputs": [], - "name": "InvalidTotalPercentage", + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + } + ], + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", "type": "error" }, { @@ -351,72 +202,75 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "converter", "type": "address" - }, + } + ], + "name": "ConverterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": true, "internalType": "address", - "name": "asset", + "name": "converter", "type": "address" - }, + } + ], + "name": "ConverterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", + "internalType": "uint8", + "name": "version", "type": "uint8" - }, + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": false, "internalType": "uint256", - "name": "percent", + "name": "oldMaxLoopsLimit", "type": "uint256" }, { "indexed": false, "internalType": "uint256", - "name": "amount", + "name": "newmaxLoopsLimit", "type": "uint256" } ], - "name": "AssetReleased", + "name": "MaxLoopsLimitUpdated", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "comptroller", + "name": "oldAccessControlManager", "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "asset", + "name": "newAccessControlManager", "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "AssetsReservesUpdated", + "name": "NewAccessControlManager", "type": "event" }, { @@ -425,23 +279,17 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "previousOwner", "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "name": "DistributionConfigAdded", + "name": "OwnershipTransferStarted", "type": "event" }, { @@ -450,222 +298,187 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "previousOwner", "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "name": "DistributionConfigRemoved", + "name": "OwnershipTransferred", "type": "event" }, { - "anonymous": false, - "inputs": [ + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "destination", + "internalType": "contract IAccessControlManagerV8", + "name": "", "type": "address" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "oldPercentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "newPercentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "DistributionConfigUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" } ], - "name": "Initialized", - "type": "event" + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "oldMaxLoopsLimit", + "name": "", "type": "uint256" - }, + } + ], + "name": "allConverters", + "outputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "newmaxLoopsLimit", - "type": "uint256" + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" } ], - "name": "MaxLoopsLimitUpdated", - "type": "event" + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": false, "internalType": "address", - "name": "oldAccessControlManager", + "name": "_tokenAddressIn", "type": "address" }, { - "indexed": false, "internalType": "address", - "name": "newAccessControlManager", + "name": "_tokenAddressOut", "type": "address" } ], - "name": "NewAccessControlManager", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "findTokenConverters", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" + "internalType": "address[]", + "name": "converters", + "type": "address[]" }, { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" } ], - "name": "OwnershipTransferStarted", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, "inputs": [ { - "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "_tokenAddressIn", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "_tokenAddressOut", "type": "address" } ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "findTokenConvertersForConverters", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "oldPoolRegistry", - "type": "address" + "internalType": "address[]", + "name": "converters", + "type": "address[]" }, { - "indexed": true, - "internalType": "address", - "name": "newPoolRegistry", - "type": "address" + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" } ], - "name": "PoolRegistryUpdated", - "type": "event" + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "inputs": [], + "name": "getAllConverters", + "outputs": [ { - "indexed": true, - "internalType": "address", - "name": "comptroller", - "type": "address" - }, + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - "indexed": true, "internalType": "address", - "name": "asset", + "name": "_accessControlManager", "type": "address" }, { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "oldBalance", - "type": "uint256" - }, - { - "indexed": false, "internalType": "uint256", - "name": "newBalance", + "name": "_loopsLimit", "type": "uint256" } ], - "name": "ReservesUpdated", - "type": "event" + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - "inputs": [], - "name": "CORE_POOL_COMPTROLLER", - "outputs": [ + "inputs": [ { "internalType": "address", - "name": "", + "name": "_tokenConverter", "type": "address" } ], + "name": "isTokenConverter", + "outputs": [ + { + "internalType": "bool", + "name": "isConverter", + "type": "bool" + } + ], "stateMutability": "view", "type": "function" }, { "inputs": [], - "name": "MAX_PERCENT", + "name": "maxLoopsLimit", "outputs": [ { - "internalType": "uint16", + "internalType": "uint256", "name": "", - "type": "uint16" + "type": "uint256" } ], "stateMutability": "view", @@ -673,7 +486,7 @@ }, { "inputs": [], - "name": "WBNB", + "name": "owner", "outputs": [ { "internalType": "address", @@ -686,17 +499,10 @@ }, { "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "accessControlManager", + "name": "pendingOwner", "outputs": [ { - "internalType": "contract IAccessControlManagerV8", + "internalType": "address", "name": "", "type": "address" } @@ -707,29 +513,19 @@ { "inputs": [ { - "components": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct ProtocolShareReserve.DistributionConfig[]", - "name": "configs", - "type": "tuple[]" + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" } ], - "name": "addOrUpdateDistributionConfigs", + "name": "removeTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -738,286 +534,304 @@ "inputs": [ { "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", + "name": "accessControlManager_", "type": "address" - }, - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "", - "type": "uint8" - } - ], - "name": "assetsReserves", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" } ], - "stateMutability": "view", + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", - "name": "", + "name": "limit", "type": "uint256" } ], - "name": "distributionTargets", - "outputs": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "stateMutability": "view", + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "destination", + "name": "newOwner", "type": "address" - }, - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - } - ], - "name": "getPercentageDistribution", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" } ], - "stateMutability": "view", + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "comptroller", + "name": "_logic", "type": "address" }, - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, { "internalType": "address", - "name": "destination", + "name": "admin_", "type": "address" }, { - "internalType": "address", - "name": "asset", - "type": "address" + "internalType": "bytes", + "name": "_data", + "type": "bytes" } ], - "name": "getUnreleasedFunds", - "outputs": [ + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "ConverterNetwork_Implementation": { + "address": "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "ConverterAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "ConverterDoesNotExist", + "type": "error" + }, + { + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "loopsLimit", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" + "name": "InvalidMaxLoopsLimit", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConverterAddress", + "type": "error" }, { "inputs": [ { - "internalType": "address", - "name": "_accessControlManager", - "type": "address" + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" }, { "internalType": "uint256", - "name": "_loopsLimit", + "name": "requiredLoops", "type": "uint256" } ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "MaxLoopsLimitExceeded", + "type": "error" }, { - "inputs": [], - "name": "maxLoopsLimit", - "outputs": [ + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" } ], - "stateMutability": "view", - "type": "function" + "name": "Unauthorized", + "type": "error" }, { "inputs": [], - "name": "owner", - "outputs": [ + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "converter", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "ConverterAdded", + "type": "event" }, { - "inputs": [], - "name": "pendingOwner", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "converter", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "ConverterRemoved", + "type": "event" }, { - "inputs": [], - "name": "poolRegistry", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" } ], - "stateMutability": "view", - "type": "function" + "name": "Initialized", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "comptroller", - "type": "address" + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" }, { - "internalType": "address[]", - "name": "assets", - "type": "address[]" + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" } ], - "name": "releaseFunds", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "MaxLoopsLimitUpdated", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" }, { + "indexed": false, "internalType": "address", - "name": "destination", + "name": "newAccessControlManager", "type": "address" } ], - "name": "removeDistributionConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "NewAccessControlManager", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "accessControlManager_", + "name": "previousOwner", "type": "address" - } - ], - "name": "setAccessControlManager", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ + }, { + "indexed": true, "internalType": "address", - "name": "_poolRegistry", + "name": "newOwner", "type": "address" } ], - "name": "setPoolRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "OwnershipTransferStarted", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", + "name": "previousOwner", "type": "address" - } - ], - "name": "totalAssetReserve", - "outputs": [ + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "stateMutability": "view", + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "totalDistributions", + "name": "accessControlManager", "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", + "type": "address" + } + ], + "name": "addTokenConverter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], + "name": "allConverters", + "outputs": [ + { + "internalType": "contract IAbstractTokenConverter", + "name": "", + "type": "address" + } + ], "stateMutability": "view", "type": "function" }, @@ -1025,12 +839,28 @@ "inputs": [ { "internalType": "address", - "name": "newOwner", + "name": "_tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "_tokenAddressOut", "type": "address" } ], - "name": "transferOwnership", - "outputs": [], + "name": "findTokenConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" + } + ], "stateMutability": "nonpayable", "type": "function" }, @@ -1038,33 +868,39 @@ "inputs": [ { "internalType": "address", - "name": "comptroller", + "name": "_tokenAddressIn", "type": "address" }, { "internalType": "address", - "name": "asset", + "name": "_tokenAddressOut", "type": "address" + } + ], + "name": "findTokenConvertersForConverters", + "outputs": [ + { + "internalType": "address[]", + "name": "converters", + "type": "address[]" }, { - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" + "internalType": "uint256[]", + "name": "convertersBalance", + "type": "uint256[]" } ], - "name": "updateAssetsState", - "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "vBNB", + "name": "getAllConverters", "outputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "internalType": "contract IAbstractTokenConverter[]", + "name": "converters", + "type": "address[]" } ], "stateMutability": "view", @@ -1074,136 +910,180 @@ "inputs": [ { "internalType": "address", - "name": "_logic", + "name": "_accessControlManager", "type": "address" }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", - "name": "admin_", + "name": "_tokenConverter", "type": "address" - }, + } + ], + "name": "isTokenConverter", + "outputs": [ { - "internalType": "bytes", - "name": "_data", - "type": "bytes" + "internalType": "bool", + "name": "isConverter", + "type": "bool" } ], - "stateMutability": "payable", - "type": "constructor" - } - ] - }, - "ProtocolShareReserve_Implementation": { - "address": "0x6B2D272CD89585BCE8404006f366a77680324F7d", - "abi": [ + "stateMutability": "view", + "type": "function" + }, { - "inputs": [ + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ { "internalType": "address", - "name": "_corePoolComptroller", + "name": "", "type": "address" - }, + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ { "internalType": "address", - "name": "_wbnb", + "name": "", "type": "address" - }, + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - "internalType": "address", - "name": "_vbnb", + "internalType": "contract IAbstractTokenConverter", + "name": "_tokenConverter", "type": "address" } ], + "name": "removeTokenConverter", + "outputs": [], "stateMutability": "nonpayable", - "type": "constructor" + "type": "function" }, { "inputs": [], - "name": "InvalidAddress", - "type": "error" + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - "inputs": [], - "name": "InvalidTotalPercentage", - "type": "error" + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { "inputs": [ { "internalType": "uint256", - "name": "loopsLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requiredLoops", + "name": "limit", "type": "uint256" } ], - "name": "MaxLoopsLimitExceeded", - "type": "error" + "name": "setMaxLoopsLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "sender", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, + "ConverterNetwork_Proxy": { + "address": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", "type": "address" }, { "internalType": "address", - "name": "calledContract", + "name": "admin_", "type": "address" }, { - "internalType": "string", - "name": "methodSignature", - "type": "string" + "internalType": "bytes", + "name": "_data", + "type": "bytes" } ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" + "stateMutability": "payable", + "type": "constructor" }, { "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "destination", + "name": "previousAdmin", "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "asset", + "name": "newAdmin", "type": "address" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "percent", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" } ], - "name": "AssetReleased", + "name": "AdminChanged", "type": "event" }, { @@ -1212,35 +1092,3972 @@ { "indexed": true, "internalType": "address", - "name": "comptroller", + "name": "beacon", "type": "address" - }, - { - "indexed": true, - "internalType": "address", + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "DefaultProxyAdmin": { + "address": "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] + }, + "ProtocolShareReserve": { + "address": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "ProtocolShareReserve_Implementation": { + "address": "0x6B2D272CD89585BCE8404006f366a77680324F7d", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_corePoolComptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "_wbnb", + "type": "address" + }, + { + "internalType": "address", + "name": "_vbnb", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, + "ProtocolShareReserve_Proxy": { + "address": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "SingleTokenConverterBeacon": { + "address": "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, + "SingleTokenConverterImp": { + "address": "0x07801d54906Be49517DfDEd26c89A81fb94e504B", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + } + ], + "name": "AmountInHigherThanMax", + "type": "error" + }, + { + "inputs": [], + "name": "AmountInMismatched", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + } + ], + "name": "AmountOutLowerThanMinRequired", + "type": "error" + }, + { + "inputs": [], + "name": "AmountOutMismatched", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionConfigNotEnabled", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionEnabledOnlyForPrivateConversions", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensActive", + "type": "error" + }, + { + "inputs": [], + "name": "ConversionTokensPaused", + "type": "error" + }, + { + "inputs": [], + "name": "DeflationaryTokenNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxIncentive", + "type": "uint256" + } + ], + "name": "IncentiveTooHigh", + "type": "error" + }, + { + "inputs": [], + "name": "InputLengthMisMatch", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientInputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientOutputAmount", + "type": "error" + }, + { + "inputs": [], + "name": "InsufficientPoolLiquidity", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidConverterNetwork", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidMinimumAmountToConvert", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidToAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTokenConfigAddresses", + "type": "error" + }, + { + "inputs": [], + "name": "NonZeroIncentiveForPrivateConversion", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetTransferredToDestination", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldBaseAsset", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newBaseAsset", + "type": "address" + } + ], + "name": "BaseAssetUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newIncentive", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "oldAccess", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "newAccess", + "type": "uint8" + } + ], + "name": "ConversionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ConversionResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "ConvertedForExactTokensSupportingFeeOnTransferTokens", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldConverterNetwork", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "converterNetwork", + "type": "address" + } + ], + "name": "ConverterNetworkAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldDestinationAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destinationAddress", + "type": "address" + } + ], + "name": "DestinationAddressUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMinAmountToConvert", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newMinAmountToConvert", + "type": "uint256" + } + ], + "name": "MinAmountToConvertUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "oldPriceOracle", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract ResilientOracle", + "name": "priceOracle", + "type": "address" + } + ], + "name": "PriceOracleUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "SweepToken", + "type": "event" + }, + { + "inputs": [], + "name": "MAX_INCENTIVE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "tokenBalance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseAsset", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "conversionConfigurations", + "outputs": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "conversionPaused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMinMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMaxMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "convertForExactTokensSupportingFeeOnTransferTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "actualAmountIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "actualAmountOut", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "converterNetwork", + "outputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "destinationAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountIn", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amountInMantissa", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + } + ], + "name": "getUpdatedAmountOut", + "outputs": [ + { + "internalType": "uint256", + "name": "amountConvertedMantissa", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amountOutMantissa", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + }, + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + }, + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + }, + { + "internalType": "address", + "name": "baseAsset_", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minAmountToConvert", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauseConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "priceOracle", + "outputs": [ + { + "internalType": "contract ResilientOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "resumeConversion", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "baseAsset_", + "type": "address" + } + ], + "name": "setBaseAsset", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address", + "name": "tokenAddressOut", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig", + "name": "conversionConfig", + "type": "tuple" + } + ], + "name": "setConversionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddressIn", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tokenAddressesOut", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "incentive", + "type": "uint256" + }, + { + "internalType": "enum IAbstractTokenConverter.ConversionAccessibility", + "name": "conversionAccess", + "type": "uint8" + } + ], + "internalType": "struct IAbstractTokenConverter.ConversionConfig[]", + "name": "conversionConfigs", + "type": "tuple[]" + } + ], + "name": "setConversionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IConverterNetwork", + "name": "converterNetwork_", + "type": "address" + } + ], + "name": "setConverterNetwork", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destinationAddress_", + "type": "address" + } + ], + "name": "setDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minAmountToConvert_", + "type": "uint256" + } + ], + "name": "setMinAmountToConvert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ResilientOracle", + "name": "priceOracle_", + "type": "address" + } + ], + "name": "setPriceOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", "name": "asset", "type": "address" - }, + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] + }, + "USDCPrimeConverter": { + "address": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "USDTPrimeConverter": { + "address": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "WBTCPrimeConverter": { + "address": "0xF91369009c37f029aa28AF89709a352375E5A162", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "WETHPrimeConverter": { + "address": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "XVSVaultConverter": { + "address": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "beacon", + "type": "address" }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ { "indexed": false, - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" + "internalType": "address", + "name": "previousAdmin", + "type": "address" }, { "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "address", + "name": "newAdmin", + "type": "address" } ], - "name": "AssetsReservesUpdated", + "name": "AdminChanged", "type": "event" }, { @@ -1249,23 +5066,11 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "beacon", "type": "address" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" } ], - "name": "DistributionConfigAdded", + "name": "BeaconUpgraded", "type": "event" }, { @@ -1274,23 +5079,43 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "implementation", "type": "address" - }, + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + }, + "XVSVaultTreasury": { + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "abi": [ + { + "anonymous": false, + "inputs": [ { "indexed": false, - "internalType": "uint16", - "name": "percentage", - "type": "uint16" + "internalType": "address", + "name": "previousAdmin", + "type": "address" }, { "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "address", + "name": "newAdmin", + "type": "address" } ], - "name": "DistributionConfigRemoved", + "name": "AdminChanged", "type": "event" }, { @@ -1299,29 +5124,157 @@ { "indexed": true, "internalType": "address", - "name": "destination", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "oldPercentage", - "type": "uint16" + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" }, { - "indexed": false, - "internalType": "uint16", - "name": "newPercentage", - "type": "uint16" + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "xvsStore", + "type": "address" }, { "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" } ], - "name": "DistributionConfigUpdated", + "name": "FundsTransferredToXVSStore", "type": "event" }, { @@ -1337,25 +5290,6 @@ "name": "Initialized", "type": "event" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldMaxLoopsLimit", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newmaxLoopsLimit", - "type": "uint256" - } - ], - "name": "MaxLoopsLimitUpdated", - "type": "event" - }, { "anonymous": false, "inputs": [ @@ -1419,17 +5353,23 @@ { "indexed": true, "internalType": "address", - "name": "oldPoolRegistry", + "name": "token", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "newPoolRegistry", + "name": "to", "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" } ], - "name": "PoolRegistryUpdated", + "name": "SweepToken", "type": "event" }, { @@ -1438,40 +5378,86 @@ { "indexed": true, "internalType": "address", - "name": "comptroller", + "name": "oldXVSVault", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "asset", + "name": "newXVSVault", "type": "address" - }, + } + ], + "name": "XVSVaultUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "XVS_ADDRESS", + "outputs": [ { - "indexed": false, - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "oldBalance", + "name": "amountMantissa", "type": "uint256" + } + ], + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" }, { - "indexed": false, - "internalType": "uint256", - "name": "newBalance", - "type": "uint256" + "internalType": "address", + "name": "xvsVault_", + "type": "address" } ], - "name": "ReservesUpdated", - "type": "event" + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { "inputs": [], - "name": "CORE_POOL_COMPTROLLER", + "name": "owner", "outputs": [ { "internalType": "address", @@ -1484,12 +5470,12 @@ }, { "inputs": [], - "name": "MAX_PERCENT", + "name": "pendingOwner", "outputs": [ { - "internalType": "uint16", + "internalType": "address", "name": "", - "type": "uint16" + "type": "address" } ], "stateMutability": "view", @@ -1497,30 +5483,79 @@ }, { "inputs": [], - "name": "WBNB", - "outputs": [ + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ { "internalType": "address", - "name": "", + "name": "accessControlManager_", "type": "address" } ], - "stateMutability": "view", + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "acceptOwnership", + "inputs": [ + { + "internalType": "address", + "name": "xvsVault_", + "type": "address" + } + ], + "name": "setXVSVault", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sweepToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "accessControlManager", + "name": "xvsVault", "outputs": [ { - "internalType": "contract IAccessControlManagerV8", + "internalType": "address", "name": "", "type": "address" } @@ -1531,175 +5566,217 @@ { "inputs": [ { - "components": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, - { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct ProtocolShareReserve.DistributionConfig[]", - "name": "configs", - "type": "tuple[]" + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "XVSVaultTreasury_Implementation": { + "address": "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "xvsAddress_", + "type": "address" } ], - "name": "addOrUpdateDistributionConfigs", - "outputs": [], "stateMutability": "nonpayable", - "type": "function" + "type": "constructor" + }, + { + "inputs": [], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroValueNotAllowed", + "type": "error" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", + "name": "xvsStore", "type": "address" }, { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "", - "type": "uint8" - } - ], - "name": "assetsReserves", - "outputs": [ - { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "amountMantissa", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" + "name": "FundsTransferredToXVSStore", + "type": "event" }, { + "anonymous": false, "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" } ], - "name": "distributionTargets", - "outputs": [ - { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - "internalType": "uint16", - "name": "percentage", - "type": "uint16" + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" }, { + "indexed": false, "internalType": "address", - "name": "destination", + "name": "newAccessControlManager", "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "NewAccessControlManager", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "destination", + "name": "previousOwner", "type": "address" }, { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - } - ], - "name": "getPercentageDistribution", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "stateMutability": "view", - "type": "function" + "name": "OwnershipTransferStarted", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "comptroller", + "name": "previousOwner", "type": "address" }, { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "address", - "name": "destination", + "name": "token", "type": "address" }, { + "indexed": true, "internalType": "address", - "name": "asset", + "name": "to", "type": "address" - } - ], - "name": "getUnreleasedFunds", - "outputs": [ + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "amount", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" + "name": "SweepToken", + "type": "event" }, { + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "_accessControlManager", + "name": "oldXVSVault", "type": "address" }, { - "internalType": "uint256", - "name": "_loopsLimit", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "newXVSVault", + "type": "address" } ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "name": "XVSVaultUpdated", + "type": "event" }, { "inputs": [], - "name": "maxLoopsLimit", + "name": "XVS_ADDRESS", "outputs": [ { - "internalType": "uint256", + "internalType": "address", "name": "", - "type": "uint256" + "type": "address" } ], "stateMutability": "view", @@ -1707,23 +5784,17 @@ }, { "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "pendingOwner", + "name": "accessControlManager", "outputs": [ { - "internalType": "address", + "internalType": "contract IAccessControlManagerV8", "name": "", "type": "address" } @@ -1732,52 +5803,60 @@ "type": "function" }, { - "inputs": [], - "name": "poolRegistry", - "outputs": [ + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "internalType": "uint256", + "name": "amountMantissa", + "type": "uint256" } ], - "stateMutability": "view", + "name": "fundXVSVault", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", - "name": "comptroller", + "name": "accessControlManager_", "type": "address" }, { - "internalType": "address[]", - "name": "assets", - "type": "address[]" + "internalType": "address", + "name": "xvsVault_", + "type": "address" } ], - "name": "releaseFunds", + "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [ + "inputs": [], + "name": "owner", + "outputs": [ { - "internalType": "enum ProtocolShareReserve.Schema", - "name": "schema", - "type": "uint8" - }, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ { "internalType": "address", - "name": "destination", + "name": "", "type": "address" } ], - "name": "removeDistributionConfig", - "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -1804,11 +5883,11 @@ "inputs": [ { "internalType": "address", - "name": "_poolRegistry", + "name": "xvsVault_", "type": "address" } ], - "name": "setPoolRegistry", + "name": "setXVSVault", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1817,43 +5896,21 @@ "inputs": [ { "internalType": "address", - "name": "", + "name": "tokenAddress", "type": "address" - } - ], - "name": "totalAssetReserve", - "outputs": [ + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalDistributions", - "outputs": [ + "internalType": "address", + "name": "to", + "type": "address" + }, { "internalType": "uint256", - "name": "", + "name": "amount", "type": "uint256" } ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", + "name": "sweepToken", "outputs": [], "stateMutability": "nonpayable", "type": "function" @@ -1862,28 +5919,18 @@ "inputs": [ { "internalType": "address", - "name": "comptroller", - "type": "address" - }, - { - "internalType": "address", - "name": "asset", + "name": "newOwner", "type": "address" - }, - { - "internalType": "enum IProtocolShareReserve.IncomeType", - "name": "incomeType", - "type": "uint8" } ], - "name": "updateAssetsState", + "name": "transferOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], - "name": "vBNB", + "name": "xvsVault", "outputs": [ { "internalType": "address", @@ -1896,8 +5943,8 @@ } ] }, - "ProtocolShareReserve_Proxy": { - "address": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41", + "XVSVaultTreasury_Proxy": { + "address": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", "abi": [ { "inputs": [ diff --git a/deployments/arbitrumone_addresses.json b/deployments/arbitrumone_addresses.json index 615f35ef..0ea063ec 100644 --- a/deployments/arbitrumone_addresses.json +++ b/deployments/arbitrumone_addresses.json @@ -2,9 +2,22 @@ "name": "arbitrumone", "chainId": "42161", "addresses": { + "ConverterNetwork": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", + "ConverterNetwork_Implementation": "0xf4b78771044D21F8289238Cad82bA5a13076aa4d", + "ConverterNetwork_Proxy": "0x2F6672C9A0988748b0172D97961BecfD9DC6D6d5", "DefaultProxyAdmin": "0xF6fF3e9459227f0cDE8B102b90bE25960317b216", "ProtocolShareReserve": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41", "ProtocolShareReserve_Implementation": "0x6B2D272CD89585BCE8404006f366a77680324F7d", - "ProtocolShareReserve_Proxy": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41" + "ProtocolShareReserve_Proxy": "0xF9263eaF7eB50815194f26aCcAB6765820B13D41", + "SingleTokenConverterBeacon": "0x993900Ab4ef4092e5B76d4781D09A2732086F0F0", + "SingleTokenConverterImp": "0x07801d54906Be49517DfDEd26c89A81fb94e504B", + "USDCPrimeConverter": "0x6553C9f9E131191d4fECb6F0E73bE13E229065C6", + "USDTPrimeConverter": "0x435Fac1B002d5D31f374E07c0177A1D709d5DC2D", + "WBTCPrimeConverter": "0xF91369009c37f029aa28AF89709a352375E5A162", + "WETHPrimeConverter": "0x4aCB90ddD6df24dC6b0D50df84C94e72012026d0", + "XVSVaultConverter": "0x9c5A7aB705EA40876c1B292630a3ff2e0c213DB1", + "XVSVaultTreasury": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58", + "XVSVaultTreasury_Implementation": "0x1052B6eEe137074761fFE040a0357e6F8c80dB8D", + "XVSVaultTreasury_Proxy": "0xb076D4f15c08D7A7B89466327Ba71bc7e1311b58" } } From 232659ba1e51be342bb9c38ead5d71be1209e4e1 Mon Sep 17 00:00:00 2001 From: Kirill Kuvshinov Date: Wed, 11 Sep 2024 15:26:29 +0300 Subject: [PATCH 15/24] chore: use lib es2020 Most of our repositories use lib es2020 (e.g. for Array.includes), and there are no known compatibility issues we resolve by using es6 here --- tsconfig.json | 4 ++-- yarn.lock | 54 ++++++++++++++++++++++++++++++++++----------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 0ff17b02..21ea5d75 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,7 @@ "esModuleInterop": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es2020"], "module": "commonjs", "moduleResolution": "node", "noImplicitAny": true, @@ -15,7 +15,7 @@ "resolveJsonModule": true, "sourceMap": true, "strict": true, - "target": "es6", + "target": "es2020", "outDir": "dist", "paths": { "@nomiclabs/hardhat-ethers": ["node_modules/hardhat-deploy-ethers"] diff --git a/yarn.lock b/yarn.lock index 127922e4..1cdd5d82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3544,7 +3544,42 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/protocol-reserve@^2.0.0, @venusprotocol/protocol-reserve@workspace:.": +"@venusprotocol/protocol-reserve@npm:^1.1.0": + version: 1.5.0 + resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" + dependencies: + "@nomiclabs/hardhat-ethers": ^2.2.3 + "@openzeppelin/contracts": ^4.8.3 + "@openzeppelin/contracts-upgradeable": ^4.8.3 + "@openzeppelin/hardhat-upgrades": ^1.21.0 + "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/solidity-utilities": ^1.3.0 + ethers: ^5.7.0 + hardhat-deploy: ^0.11.14 + module-alias: ^2.2.2 + checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 + languageName: node + linkType: hard + +"@venusprotocol/protocol-reserve@npm:^2.0.0": + version: 2.4.0 + resolution: "@venusprotocol/protocol-reserve@npm:2.4.0" + dependencies: + "@nomiclabs/hardhat-ethers": ^2.2.3 + "@openzeppelin/contracts": ^4.8.3 + "@openzeppelin/contracts-upgradeable": ^4.8.3 + "@openzeppelin/hardhat-upgrades": ^1.21.0 + "@solidity-parser/parser": ^0.13.2 + "@venusprotocol/solidity-utilities": ^2.0.3 + "@venusprotocol/venus-protocol": ^9.1.0 + ethers: ^5.7.0 + hardhat-deploy: ^0.11.14 + module-alias: ^2.2.2 + checksum: 6e5ffa1c458cff073f9b920ab6385d9db0c86ac11d0950fe421a853e709ee12ec0013c6d3e9cb4e50e94f749dcd33e7a515d57828c5aa6f925dee8324e896ee5 + languageName: node + linkType: hard + +"@venusprotocol/protocol-reserve@workspace:.": version: 0.0.0-use.local resolution: "@venusprotocol/protocol-reserve@workspace:." dependencies: @@ -3612,23 +3647,6 @@ __metadata: languageName: unknown linkType: soft -"@venusprotocol/protocol-reserve@npm:^1.1.0": - version: 1.5.0 - resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^1.3.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 - languageName: node - linkType: hard - "@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0": version: 2.0.0 resolution: "@venusprotocol/solidity-utilities@npm:2.0.0" From 1986c6aabfb5b6e7483df9f8fce73957b49fc27d Mon Sep 17 00:00:00 2001 From: Corey Rice Date: Thu, 21 Nov 2024 23:52:21 -0300 Subject: [PATCH 16/24] refactor!: support project and full protocol hardhat deploy --- deploy/{001-psr.ts => 000-psr.ts} | 33 ++++---- ...06-risk-fund-v2.ts => 001-risk-fund-v2.ts} | 17 ++-- deploy/002-risk-fund-converter.ts | 78 ++++++++--------- deploy/003-xvs-vault-treasury.ts | 29 +++---- deploy/004-single-token-converter.ts | 83 ++++++++++--------- deploy/005-converter-network.ts | 22 ++--- hardhat.config.ts | 6 ++ helpers/utils.ts | 1 - 8 files changed, 148 insertions(+), 121 deletions(-) rename deploy/{001-psr.ts => 000-psr.ts} (65%) rename deploy/{006-risk-fund-v2.ts => 001-risk-fund-v2.ts} (82%) diff --git a/deploy/001-psr.ts b/deploy/000-psr.ts similarity index 65% rename from deploy/001-psr.ts rename to deploy/000-psr.ts index 49a6fbfe..15830bea 100644 --- a/deploy/001-psr.ts +++ b/deploy/000-psr.ts @@ -13,10 +13,10 @@ const func: DeployFunction = async ({ const { deployer } = await getNamedAccounts(); const vBNBAddress = (await ethers.getContractOrNull("vBNB"))?.address || ADDRESS_ONE; - const comptrollerAddress = (await ethers.getContractOrNull("Unitroller"))?.address || ADDRESS_ONE; + const comptrollerAddress = (await ethers.getContract("Unitroller"))?.address; const WBNBAddress = (await ethers.getContractOrNull("WBNB"))?.address || ADDRESS_ONE; - const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; + const timelockAddress = (await ethers.getContract("NormalTimelock"))?.address || multisigs[name]; + const acmAddress = (await ethers.getContract("AccessControlManager"))?.address; const loopsLimit = 20; const defaultProxyAdmin = await hre.artifacts.readArtifact( @@ -28,19 +28,20 @@ const func: DeployFunction = async ({ log: true, deterministicDeployment: false, args: [comptrollerAddress, WBNBAddress, vBNBAddress], - skipIfAlreadyDeployed: true, - proxy: { - owner: live ? timelockAddress : deployer, - proxyContract: "OptimizedTransparentUpgradeableProxy", - execute: { - methodName: "initialize", - args: [acmAddress, loopsLimit], - }, - viaAdminContract: { - name: "DefaultProxyAdmin", - artifact: defaultProxyAdmin, - }, - }, + proxy: live + ? { + owner: timelockAddress, + proxyContract: "OpenZeppelinTransparentProxy", + execute: { + methodName: "initialize", + args: [acmAddress, loopsLimit], + }, + viaAdminContract: { + name: "DefaultProxyAdmin", + artifact: defaultProxyAdmin, + }, + } + : undefined, }); const psr = await hre.ethers.getContract("ProtocolShareReserve"); diff --git a/deploy/006-risk-fund-v2.ts b/deploy/001-risk-fund-v2.ts similarity index 82% rename from deploy/006-risk-fund-v2.ts rename to deploy/001-risk-fund-v2.ts index f607d5f8..46e2cf76 100644 --- a/deploy/006-risk-fund-v2.ts +++ b/deploy/001-risk-fund-v2.ts @@ -13,16 +13,21 @@ const func: DeployFunction = async ({ const { deployer } = await getNamedAccounts(); const proxyAdmin = await ethers.getContract("DefaultProxyAdmin"); - const owner = await proxyAdmin.owner(); + let owner = deployer; + if (live) { + owner = await proxyAdmin.owner(); + } await deploy("RiskFundV2", { from: deployer, contract: "RiskFundV2", - proxy: { - owner: owner, - proxyContract: "OpenZeppelinTransparentProxy", - upgradeIndex: 0, - }, + proxy: live + ? { + owner: owner, + proxyContract: "OpenZeppelinTransparentProxy", + upgradeIndex: 0, + } + : undefined, autoMine: true, log: true, }); diff --git a/deploy/002-risk-fund-converter.ts b/deploy/002-risk-fund-converter.ts index d2d7dd13..a5869529 100644 --- a/deploy/002-risk-fund-converter.ts +++ b/deploy/002-risk-fund-converter.ts @@ -1,5 +1,5 @@ import { parseUnits } from "ethers/lib/utils"; -import { ethers, network } from "hardhat"; +import { ethers } from "hardhat"; import { DeployFunction } from "hardhat-deploy/types"; import { HardhatRuntimeEnvironment } from "hardhat/types"; @@ -15,29 +15,31 @@ const func: DeployFunction = async ({ const { deploy } = deployments; const { deployer } = await getNamedAccounts(); - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; - const oracleAddress = (await ethers.getContractOrNull("ResilientOracle"))?.address || ADDRESS_ONE; - const usdtAddress = (await ethers.getContractOrNull("USDT"))?.address || ADDRESS_ONE; - const corePoolAddress = (await ethers.getContractOrNull("Unitroller"))?.address || ADDRESS_ONE; - const btcbAddress = (await ethers.getContractOrNull("BTCB"))?.address || ADDRESS_ONE; - const ethAddress = (await ethers.getContractOrNull("ETH"))?.address || ADDRESS_ONE; + const acmAddress = (await ethers.getContract("AccessControlManager"))?.address; + const oracleAddress = (await ethers.getContract("ResilientOracle"))?.address; + const usdtAddress = (await ethers.getContract("USDT"))?.address; + const corePoolAddress = (await ethers.getContract("Unitroller"))?.address; + const btcbAddress = (await ethers.getContract("BTCB"))?.address; + + const ethAddress = (await ethers.getContract("ETH"))?.address; const vBNBAddress = (await ethers.getContractOrNull("vBNB"))?.address || ADDRESS_ONE; const wBNBAddress = (await ethers.getContractOrNull("WBNB"))?.address || ADDRESS_ONE; - const riskFundAddress = (await ethers.getContractOrNull("RiskFund"))?.address || ADDRESS_ONE; - const poolRegistryAddress = (await ethers.getContractOrNull("PoolRegistry"))?.address || ADDRESS_ONE; - const poolDeFiAddress = (await ethers.getContractOrNull("Comptroller_DeFi"))?.address || ADDRESS_ONE; - const poolGameFiAddress = (await ethers.getContractOrNull("Comptroller_GameFi"))?.address || ADDRESS_ONE; - const poolTronAddress = (await ethers.getContractOrNull("Comptroller_Tron"))?.address || ADDRESS_ONE; - const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; - - let poolStableCoinAddress; - if (network.name === "bscmainnet") { - poolStableCoinAddress = (await ethers.getContractOrNull("Comptroller_Stablecoins"))?.address || ADDRESS_ONE; + const riskFundAddress = (await ethers.getContract("RiskFundV2"))?.address; + const poolRegistryAddress = (await ethers.getContract("PoolRegistry"))?.address; + let comptrollers; + const timelockAddress = (await ethers.getContract("NormalTimelock"))?.address || multisigs[name]; + if (live) { + const poolDeFiAddress = (await ethers.getContract("Comptroller_DeFi"))?.address; + const poolGameFiAddress = (await ethers.getContract("Comptroller_GameFi"))?.address; + const poolTronAddress = (await ethers.getContract("Comptroller_Tron"))?.address; + const poolStableCoinAddress = (await ethers.getContract("Comptroller_Stablecoins"))?.address; + comptrollers = [corePoolAddress, poolStableCoinAddress, poolDeFiAddress, poolGameFiAddress, poolTronAddress]; } else { - poolStableCoinAddress = (await ethers.getContractOrNull("Comptroller_StableCoins"))?.address || ADDRESS_ONE; + const pool1Address = (await ethers.getContractOrNull("Comptroller_Pool1"))?.address || ADDRESS_ONE; + const pool2Address = (await ethers.getContractOrNull("Comptroller_Pool2"))?.address || ADDRESS_ONE; + comptrollers = [pool1Address, pool2Address]; } - const comptrollers = [corePoolAddress, poolStableCoinAddress, poolDeFiAddress, poolGameFiAddress, poolTronAddress]; const assets = [[usdtAddress, btcbAddress, ethAddress], [usdtAddress], [usdtAddress], [usdtAddress], [usdtAddress]]; const values = [[true, true, true], [true], [true], [true], [true]]; @@ -45,24 +47,26 @@ const func: DeployFunction = async ({ from: deployer, contract: "RiskFundConverter", args: [corePoolAddress, vBNBAddress, wBNBAddress], - proxy: { - owner: live ? timelockAddress : deployer, - proxyContract: "OpenZeppelinTransparentProxy", - execute: { - methodName: "initialize", - args: [ - acmAddress, - oracleAddress, - riskFundAddress, - poolRegistryAddress, - MIN_AMOUNT_TO_CONVERT, - comptrollers, - assets, - values, - ], - }, - upgradeIndex: 0, - }, + proxy: live + ? { + owner: timelockAddress, + proxyContract: "OpenZeppelinTransparentProxy", + execute: { + methodName: "initialize", + args: [ + acmAddress, + oracleAddress, + riskFundAddress, + poolRegistryAddress, + MIN_AMOUNT_TO_CONVERT, + comptrollers, + assets, + values, + ], + }, + upgradeIndex: 0, + } + : undefined, autoMine: true, log: true, }); diff --git a/deploy/003-xvs-vault-treasury.ts b/deploy/003-xvs-vault-treasury.ts index 10d47c09..66373bb9 100644 --- a/deploy/003-xvs-vault-treasury.ts +++ b/deploy/003-xvs-vault-treasury.ts @@ -1,31 +1,32 @@ import { ethers } from "hardhat"; import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { ADDRESS_ONE, multisigs } from "../helpers/utils"; +import { multisigs } from "../helpers/utils"; const func = async ({ network: { live, name }, getNamedAccounts, deployments }: HardhatRuntimeEnvironment) => { const { deploy } = deployments; const { deployer } = await getNamedAccounts(); - const xvsAddress = (await ethers.getContractOrNull("XVS"))?.address || ADDRESS_ONE; - const proxyOwnerAddress = - (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name] || ADDRESS_ONE; - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; - const xvsVaultAddress = (await ethers.getContractOrNull("XVSVaultProxy"))?.address || ADDRESS_ONE; + const xvsAddress = (await ethers.getContract("XVS"))?.address; + const proxyOwnerAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; + const acmAddress = (await ethers.getContract("AccessControlManager"))?.address; + const xvsVaultAddress = (await ethers.getContract("XVSVaultProxy"))?.address; await deploy("XVSVaultTreasury", { from: deployer, log: true, deterministicDeployment: false, args: [xvsAddress], - proxy: { - owner: live ? proxyOwnerAddress : deployer, - proxyContract: "OpenZeppelinTransparentProxy", - execute: { - methodName: "initialize", - args: [acmAddress, xvsVaultAddress], - }, - }, + proxy: live + ? { + owner: proxyOwnerAddress, + proxyContract: "OpenZeppelinTransparentProxy", + execute: { + methodName: "initialize", + args: [acmAddress, xvsVaultAddress], + }, + } + : undefined, }); const xvsVaultTreasury = await ethers.getContract("XVSVaultTreasury"); diff --git a/deploy/004-single-token-converter.ts b/deploy/004-single-token-converter.ts index 6af25f85..b1e6c8d5 100644 --- a/deploy/004-single-token-converter.ts +++ b/deploy/004-single-token-converter.ts @@ -4,52 +4,61 @@ import { DeployResult } from "hardhat-deploy/dist/types"; import { DeployFunction } from "hardhat-deploy/types"; import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { ADDRESS_ONE, ADDRESS_TWO, multisigs } from "../helpers/utils"; +import { multisigs } from "../helpers/utils"; + +type NETWORK = "hardhat" | "bsctestnet" | "bscmainnet" | "sepolia" | "ethereum"; interface BaseAssets { [key: string]: string; } -async function getBaseAssets(network: string): Promise { - const networkBaseAssets: { [key: string]: BaseAssets } = { - bsctestnet: { - USDTPrimeConverter: (await ethers.getContractOrNull("USDT"))?.address || ADDRESS_ONE, - USDCPrimeConverter: (await ethers.getContractOrNull("USDC"))?.address || ADDRESS_ONE, - BTCBPrimeConverter: (await ethers.getContractOrNull("BTCB"))?.address || ADDRESS_ONE, - ETHPrimeConverter: (await ethers.getContractOrNull("ETH"))?.address || ADDRESS_ONE, - XVSVaultConverter: (await ethers.getContractOrNull("XVS"))?.address || ADDRESS_TWO, - }, - bscmainnet: { - USDTPrimeConverter: (await ethers.getContractOrNull("USDT"))?.address || ADDRESS_ONE, - USDCPrimeConverter: (await ethers.getContractOrNull("USDC"))?.address || ADDRESS_ONE, - BTCBPrimeConverter: (await ethers.getContractOrNull("BTCB"))?.address || ADDRESS_ONE, - ETHPrimeConverter: (await ethers.getContractOrNull("ETH"))?.address || ADDRESS_ONE, - XVSVaultConverter: (await ethers.getContractOrNull("XVS"))?.address || ADDRESS_TWO, - }, - sepolia: { - USDTPrimeConverter: (await ethers.getContractOrNull("MockUSDT"))?.address || ADDRESS_ONE, - USDCPrimeConverter: (await ethers.getContractOrNull("MockUSDC"))?.address || ADDRESS_ONE, - WBTCPrimeConverter: (await ethers.getContractOrNull("MockWBTC"))?.address || ADDRESS_ONE, +async function getBaseAssets(network: NETWORK): Promise { + const networkBaseAssets = { + hardhat: async () => ({ + USDTPrimeConverter: (await ethers.getContract("USDT"))?.address, + USDCPrimeConverter: (await ethers.getContract("USDC"))?.address, + BTCBPrimeConverter: (await ethers.getContract("BTCB"))?.address, + ETHPrimeConverter: (await ethers.getContract("ETH"))?.address, + XVSVaultConverter: (await ethers.getContract("XVS"))?.address, + }), + bsctestnet: async () => ({ + USDTPrimeConverter: (await ethers.getContract("USDT"))?.address, + USDCPrimeConverter: (await ethers.getContract("USDC"))?.address, + BTCBPrimeConverter: (await ethers.getContract("BTCB"))?.address, + ETHPrimeConverter: (await ethers.getContract("ETH"))?.address, + XVSVaultConverter: (await ethers.getContract("XVS"))?.address, + }), + bscmainnet: async () => ({ + USDTPrimeConverter: (await ethers.getContract("USDT"))?.address, + USDCPrimeConverter: (await ethers.getContract("USDC"))?.address, + BTCBPrimeConverter: (await ethers.getContract("BTCB"))?.address, + ETHPrimeConverter: (await ethers.getContract("ETH"))?.address, + XVSVaultConverter: (await ethers.getContract("XVS"))?.address, + }), + sepolia: async () => ({ + USDTPrimeConverter: (await ethers.getContract("MockUSDT"))?.address, + USDCPrimeConverter: (await ethers.getContract("MockUSDC"))?.address, + WBTCPrimeConverter: (await ethers.getContract("MockWBTC"))?.address, WETHPrimeConverter: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9", // WETH on Sepolia - XVSVaultConverter: (await ethers.getContractOrNull("XVS"))?.address || ADDRESS_TWO, - }, - ethereum: { + XVSVaultConverter: (await ethers.getContract("XVS"))?.address, + }), + ethereum: async () => ({ USDTPrimeConverter: "0xdAC17F958D2ee523a2206206994597C13D831ec7", // USDT on Ethereum USDCPrimeConverter: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC on Ethereum WBTCPrimeConverter: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", // WBTC on Ethereum WETHPrimeConverter: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // WETH on Ethereum - XVSVaultConverter: (await ethers.getContractOrNull("XVS"))?.address || ADDRESS_TWO, - }, - arbitrumsepolia: { + XVSVaultConverter: (await ethers.getContract("XVS"))?.address, + }), + arbitrumsepolia: async () => ({ USDTPrimeConverter: "0xf3118a17863996B9F2A073c9A66Faaa664355cf8", // USDT on arbitrum sepolia USDCPrimeConverter: "0x86f096B1D970990091319835faF3Ee011708eAe8", // USDC on arbitrum sepolia WBTCPrimeConverter: "0xFb8d93FD3Cf18386a5564bb5619cD1FdB130dF7D", // WBTC on arbitrum sepolia WETHPrimeConverter: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", // WETH on arbitrum sepolia XVSVaultConverter: "0x877Dc896e7b13096D3827872e396927BbE704407", // XVS on arbitrum sepolia - }, + }), // add more networks }; - return networkBaseAssets[network]; + return await networkBaseAssets[network](); } const MIN_AMOUNT_TO_CONVERT = parseUnits("10", 18).toString(); @@ -59,13 +68,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const { deploy } = deployments; const { deployer } = await getNamedAccounts(); - const networkName = network.name; + const networkName = network.name as NETWORK; + const baseAssets: BaseAssets = await getBaseAssets(networkName); - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; - const oracleAddress = (await ethers.getContractOrNull("ResilientOracle"))?.address || ADDRESS_ONE; - const proxyOwnerAddress = - (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[networkName] || ADDRESS_ONE; + const acmAddress = (await ethers.getContract("AccessControlManager"))?.address; + const oracleAddress = (await ethers.getContract("ResilientOracle"))?.address; + const proxyOwnerAddress = (await ethers.getContract("NormalTimelock"))?.address || multisigs[networkName]; const singleTokenConverterImp: DeployResult = await deploy("SingleTokenConverterImp", { contract: "SingleTokenConverter", @@ -88,10 +97,10 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { for (const singleTokenConverterName in baseAssets) { const baseAsset: string = baseAssets[singleTokenConverterName]; - let destinationAddress = (await ethers.getContractOrNull("PrimeLiquidityProvider"))?.address || ADDRESS_ONE; + let destinationAddress = (await ethers.getContract("PrimeLiquidityProvider"))?.address; - if (baseAsset == ((await ethers.getContractOrNull("XVS"))?.address || ADDRESS_TWO)) { - destinationAddress = (await ethers.getContractOrNull("XVSVaultTreasury"))?.address || ADDRESS_ONE; + if (baseAsset == (await ethers.getContract("XVS"))?.address) { + destinationAddress = (await ethers.getContract("XVSVaultTreasury"))?.address; } const args: string[] = [acmAddress, oracleAddress, destinationAddress, baseAsset, MIN_AMOUNT_TO_CONVERT]; diff --git a/deploy/005-converter-network.ts b/deploy/005-converter-network.ts index 799e5085..ee6ebaf1 100644 --- a/deploy/005-converter-network.ts +++ b/deploy/005-converter-network.ts @@ -1,7 +1,7 @@ import { ethers } from "hardhat"; import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { ADDRESS_ONE, multisigs } from "../helpers/utils"; +import { multisigs } from "../helpers/utils"; const MAX_LOOPS_LIMIT = 20; @@ -10,20 +10,22 @@ const func = async ({ network: { live, name }, getNamedAccounts, deployments }: const { deployer } = await getNamedAccounts(); const timelockAddress = (await ethers.getContractOrNull("NormalTimelock"))?.address || multisigs[name]; - const acmAddress = (await ethers.getContractOrNull("AccessControlManager"))?.address || ADDRESS_ONE; + const acmAddress = (await ethers.getContract("AccessControlManager"))?.address; await deploy("ConverterNetwork", { from: deployer, log: true, deterministicDeployment: false, - proxy: { - owner: live ? timelockAddress : deployer, - proxyContract: "OpenZeppelinTransparentProxy", - execute: { - methodName: "initialize", - args: [acmAddress, MAX_LOOPS_LIMIT], - }, - }, + proxy: live + ? { + owner: timelockAddress, + proxyContract: "OpenZeppelinTransparentProxy", + execute: { + methodName: "initialize", + args: [acmAddress, MAX_LOOPS_LIMIT], + }, + } + : undefined, }); const converterNetwork = await ethers.getContract("ConverterNetwork"); diff --git a/hardhat.config.ts b/hardhat.config.ts index 65197e9a..0017374c 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -24,6 +24,12 @@ const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY; // if we define the Oracle deployments at last then DefaultProxyAdmin of current repository will be overwritten by DefaultProxyAdmin of Oracle // when the export deployment command executes independently for each network. const externalDeployments = { + hardhat: [ + "node_modules/@venusprotocol/isolated-pools/deployments/bscmainnet", + "node_modules/@venusprotocol/venus-protocol/deployments/bscmainnet", + "node_modules/@venusprotocol/governance-contracts/deployments/bscmainnet", + "node_modules/@venusprotocol/oracle/deployments/bscmainnet", + ], bsctestnet: [ "node_modules/@venusprotocol/governance-contracts/deployments/bsctestnet", "node_modules/@venusprotocol/oracle/deployments/bsctestnet", diff --git a/helpers/utils.ts b/helpers/utils.ts index 40f07c80..31b3f288 100644 --- a/helpers/utils.ts +++ b/helpers/utils.ts @@ -18,7 +18,6 @@ export const convertToUnit = (amount: string | number, decimals: number) => { }; export const ADDRESS_ONE = "0x0000000000000000000000000000000000000001"; -export const ADDRESS_TWO = "0x0000000000000000000000000000000000000002"; interface ChainAddressesConfig { [key: string]: string; From f73daa9727c22baeddf5d35f603c857b85181596 Mon Sep 17 00:00:00 2001 From: Venus Tools Date: Fri, 22 Nov 2024 18:40:59 +0000 Subject: [PATCH 17/24] chore(release): 3.0.0-dev.1 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [3.0.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.5.0-dev.1...v3.0.0-dev.1) (2024-11-22) ### ⚠ BREAKING CHANGES * support project and full protocol hardhat deploy ### Code Refactoring * support project and full protocol hardhat deploy ([1986c6a](https://github.com/VenusProtocol/protocol-reserve/commit/1986c6aabfb5b6e7483df9f8fce73957b49fc27d)) --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97d05276..2ec420fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## [3.0.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.5.0-dev.1...v3.0.0-dev.1) (2024-11-22) + + +### ⚠ BREAKING CHANGES + +* support project and full protocol hardhat deploy + +### Code Refactoring + +* support project and full protocol hardhat deploy ([1986c6a](https://github.com/VenusProtocol/protocol-reserve/commit/1986c6aabfb5b6e7483df9f8fce73957b49fc27d)) + ## [2.5.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.4.0...v2.5.0-dev.1) (2024-11-18) diff --git a/package.json b/package.json index a1521d8b..581e38dd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@venusprotocol/protocol-reserve", "description": "Venus Protocol contracts to manage the income generated by the protocol", - "version": "2.5.0-dev.1", + "version": "3.0.0-dev.1", "author": "Venus", "engines": { "node": ">=18.0.0" From b93a2dd77ffb7b6bb268aa93f97ba2fa0de8610e Mon Sep 17 00:00:00 2001 From: Venus Tools Date: Wed, 27 Nov 2024 14:09:52 +0000 Subject: [PATCH 18/24] chore(release): 3.0.0-dev.2 [skip ci] ## [3.0.0-dev.2](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.1...v3.0.0-dev.2) (2024-11-27) ### Features * converter network deployment files on arbitrum one ([c6c2f50](https://github.com/VenusProtocol/protocol-reserve/commit/c6c2f501d6711bd176c97c713d41fe20d2eefa92)) * converters deployment files on arbitrum one ([e0397f0](https://github.com/VenusProtocol/protocol-reserve/commit/e0397f005b0f68afbe91b58518a34f06177f6fa9)) * updating deployment files ([f0d55ad](https://github.com/VenusProtocol/protocol-reserve/commit/f0d55ad2ec076ebe45f2fe79c7ddeeb7784b5381)) * xvs vault treasury on arbitrum one ([88c440a](https://github.com/VenusProtocol/protocol-reserve/commit/88c440ab84be079a7465f0a4cf16950e56f3073c)) --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ec420fc..ac08c607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [3.0.0-dev.2](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.1...v3.0.0-dev.2) (2024-11-27) + + +### Features + +* converter network deployment files on arbitrum one ([c6c2f50](https://github.com/VenusProtocol/protocol-reserve/commit/c6c2f501d6711bd176c97c713d41fe20d2eefa92)) +* converters deployment files on arbitrum one ([e0397f0](https://github.com/VenusProtocol/protocol-reserve/commit/e0397f005b0f68afbe91b58518a34f06177f6fa9)) +* updating deployment files ([f0d55ad](https://github.com/VenusProtocol/protocol-reserve/commit/f0d55ad2ec076ebe45f2fe79c7ddeeb7784b5381)) +* xvs vault treasury on arbitrum one ([88c440a](https://github.com/VenusProtocol/protocol-reserve/commit/88c440ab84be079a7465f0a4cf16950e56f3073c)) + ## [3.0.0-dev.1](https://github.com/VenusProtocol/protocol-reserve/compare/v2.5.0-dev.1...v3.0.0-dev.1) (2024-11-22) diff --git a/package.json b/package.json index 581e38dd..f43d6902 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@venusprotocol/protocol-reserve", "description": "Venus Protocol contracts to manage the income generated by the protocol", - "version": "3.0.0-dev.1", + "version": "3.0.0-dev.2", "author": "Venus", "engines": { "node": ">=18.0.0" From d25669c351d286c2430e1c781d09526ced1fb6ce Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Tue, 3 Dec 2024 10:35:27 +0100 Subject: [PATCH 19/24] chore: update deps and add deployments --- hardhat.config.ts | 24 +++++-- package.json | 4 +- yarn.lock | 159 ++++++++++++++++++++++++++-------------------- 3 files changed, 112 insertions(+), 75 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index c7c82d7c..44e5016e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -55,10 +55,26 @@ const externalDeployments = { "node_modules/@venusprotocol/governance-contracts/deployments/opbnbmainnet", "node_modules/@venusprotocol/oracle/deployments/opbnbmainnet", ], - arbitrumsepolia: ["node_modules/@venusprotocol/governance-contracts/deployments/arbitrumsepolia"], - arbitrumone: ["node_modules/@venusprotocol/governance-contracts/deployments/arbitrumone"], - opsepolia: ["node_modules/@venusprotocol/governance-contracts/deployments/opsepolia"], - opmainnet: [], + arbitrumsepolia: [ + "node_modules/@venusprotocol/governance-contracts/deployments/arbitrumsepolia", + "node_modules/@venusprotocol/oracle/deployments/arbitrumsepolia", + ], + arbitrumone: [ + "node_modules/@venusprotocol/governance-contracts/deployments/arbitrumone", + "node_modules/@venusprotocol/oracle/deployments/arbitrumone", + ], + opsepolia: [ + "node_modules/@venusprotocol/governance-contracts/deployments/opsepolia", + "node_modules/@venusprotocol/oracle/deployments/opsepolia", + ], + opmainnet: [ + "node_modules/@venusprotocol/governance-contracts/deployments/opmainnet", + "node_modules/@venusprotocol/oracle/deployments/opmainnet", + ], + basesepolia: [ + "node_modules/@venusprotocol/governance-contracts/deployments/basesepolia", + // TODO: "node_modules/@venusprotocol/oracle/deployments/basesepolia", + ], }; extendConfig((config: HardhatConfig) => { diff --git a/package.json b/package.json index 0524ad7d..dd04f25f 100644 --- a/package.json +++ b/package.json @@ -76,9 +76,9 @@ "@types/node": "^18.16.3", "@typescript-eslint/eslint-plugin": "^5.44.0", "@typescript-eslint/parser": "^5.44.0", - "@venusprotocol/governance-contracts": "^2.4.0", + "@venusprotocol/governance-contracts": "^2.5.0", "@venusprotocol/isolated-pools": "^3.4.0", - "@venusprotocol/oracle": "^2.4.0", + "@venusprotocol/oracle": "^2.6.0", "bignumber.js": "^9.1.1", "chai": "^4.3.7", "dotenv": "^16.0.3", diff --git a/yarn.lock b/yarn.lock index 127922e4..db07012d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -502,7 +502,7 @@ __metadata: languageName: node linkType: hard -"@defi-wonderland/smock@npm:^2.2.0, @defi-wonderland/smock@npm:^2.3.4": +"@defi-wonderland/smock@npm:2.3.5, @defi-wonderland/smock@npm:^2.2.0": version: 2.3.5 resolution: "@defi-wonderland/smock@npm:2.3.5" dependencies: @@ -3473,17 +3473,6 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/governance-contracts@npm:^1.4.0-dev.1": - version: 1.4.0 - resolution: "@venusprotocol/governance-contracts@npm:1.4.0" - dependencies: - "@venusprotocol/solidity-utilities": ^1.1.0 - hardhat-deploy-ethers: ^0.3.0-beta.13 - module-alias: ^2.2.2 - checksum: 85c6b6a815edb0befa4c38e3652a58464827d390620210b99575c16960ee6505e95e7c2192ebc972da7ed758d3c62e150d32fbdd1f01acab1731f29b11d1884e - languageName: node - linkType: hard - "@venusprotocol/governance-contracts@npm:^2.1.0": version: 2.1.0 resolution: "@venusprotocol/governance-contracts@npm:2.1.0" @@ -3506,6 +3495,17 @@ __metadata: languageName: node linkType: hard +"@venusprotocol/governance-contracts@npm:^2.5.0": + version: 2.5.0 + resolution: "@venusprotocol/governance-contracts@npm:2.5.0" + dependencies: + "@venusprotocol/solidity-utilities": 2.0.0 + hardhat-deploy-ethers: ^0.3.0-beta.13 + module-alias: ^2.2.2 + checksum: 1dce18deb79df8dbde91ff3b68c35c31fb58bd7549bba86ee25fcf99a802e393612ac6f5460c95c1bc635c2334f8c967409cf380758cafc81f42a562ac8514c1 + languageName: node + linkType: hard + "@venusprotocol/isolated-pools@npm:^3.4.0": version: 3.4.0 resolution: "@venusprotocol/isolated-pools@npm:3.4.0" @@ -3523,24 +3523,24 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/oracle@npm:^2.4.0": - version: 2.4.0 - resolution: "@venusprotocol/oracle@npm:2.4.0" +"@venusprotocol/oracle@npm:^2.6.0": + version: 2.6.0 + resolution: "@venusprotocol/oracle@npm:2.6.0" dependencies: "@chainlink/contracts": ^0.5.1 - "@defi-wonderland/smock": ^2.3.4 + "@defi-wonderland/smock": 2.3.5 "@nomicfoundation/hardhat-network-helpers": ^1.0.8 "@openzeppelin/contracts": ^4.6.0 "@openzeppelin/contracts-upgradeable": ^4.7.3 - "@venusprotocol/governance-contracts": ^2.1.0 + "@venusprotocol/governance-contracts": ^2.4.0 "@venusprotocol/solidity-utilities": ^2.0.0 - "@venusprotocol/venus-protocol": ^6.0.0 + "@venusprotocol/venus-protocol": ^9.1.0 ethers: ^5.6.8 - hardhat: ^2.16.1 - hardhat-deploy: ^0.11.14 + hardhat: 2.19.5 + hardhat-deploy: ^0.12.4 module-alias: ^2.2.2 solidity-docgen: ^0.6.0-beta.29 - checksum: 8fbe113f6925526f06ca6ba76b9d524b869e650463783f44c7c2975f84a087575c19868a421caccfa6d2610af45b5265656cfbec99cfbf6a7ce9783837ffc6cf + checksum: 47c36e0cbba6f4963113e8e2db268063a52f4ffe913a8aab398f25d5c83ac5f448e45cb57992cb8f406e1be9a581557b7c75c4d8754d42f5d3164bff49f2b5c9 languageName: node linkType: hard @@ -3575,9 +3575,9 @@ __metadata: "@types/node": ^18.16.3 "@typescript-eslint/eslint-plugin": ^5.44.0 "@typescript-eslint/parser": ^5.44.0 - "@venusprotocol/governance-contracts": ^2.4.0 + "@venusprotocol/governance-contracts": ^2.5.0 "@venusprotocol/isolated-pools": ^3.4.0 - "@venusprotocol/oracle": ^2.4.0 + "@venusprotocol/oracle": ^2.6.0 "@venusprotocol/solidity-utilities": ^2.0.3 "@venusprotocol/venus-protocol": ^9.1.0 bignumber.js: ^9.1.1 @@ -3612,23 +3612,6 @@ __metadata: languageName: unknown linkType: soft -"@venusprotocol/protocol-reserve@npm:^1.1.0": - version: 1.5.0 - resolution: "@venusprotocol/protocol-reserve@npm:1.5.0" - dependencies: - "@nomiclabs/hardhat-ethers": ^2.2.3 - "@openzeppelin/contracts": ^4.8.3 - "@openzeppelin/contracts-upgradeable": ^4.8.3 - "@openzeppelin/hardhat-upgrades": ^1.21.0 - "@solidity-parser/parser": ^0.13.2 - "@venusprotocol/solidity-utilities": ^1.3.0 - ethers: ^5.7.0 - hardhat-deploy: ^0.11.14 - module-alias: ^2.2.2 - checksum: 813bc162103ab756e84bbb0e65fd416ed105cb4a06f9fe55d4a2a066af5bd63b11ca9f2c791376148114ce2b469970c8fe29c85ee1d47f9da9841f2eac8b01e0 - languageName: node - linkType: hard - "@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0": version: 2.0.0 resolution: "@venusprotocol/solidity-utilities@npm:2.0.0" @@ -3636,20 +3619,6 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/solidity-utilities@npm:^1.1.0": - version: 1.1.0 - resolution: "@venusprotocol/solidity-utilities@npm:1.1.0" - checksum: 3b17ec451cd0ba5aaea76686c7bef35757fb158709214be094f73ebd0d643c79817159f7aa162cc694e1a5ee1f02b20e26211a65929113b985827959aae99fa7 - languageName: node - linkType: hard - -"@venusprotocol/solidity-utilities@npm:^1.3.0": - version: 1.3.0 - resolution: "@venusprotocol/solidity-utilities@npm:1.3.0" - checksum: d1109365a5e01959c47b25fb129373db93792e60bf1bc0ed324b63c2a64f6e4a7878ebf016cfade94bc41a2c1245d3e861fdc6b8c5844ac210ed1d73e7307e72 - languageName: node - linkType: hard - "@venusprotocol/solidity-utilities@npm:^2.0.3": version: 2.0.3 resolution: "@venusprotocol/solidity-utilities@npm:2.0.3" @@ -3672,21 +3641,6 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/venus-protocol@npm:^6.0.0": - version: 6.0.0 - resolution: "@venusprotocol/venus-protocol@npm:6.0.0" - dependencies: - "@openzeppelin/contracts": 4.9.3 - "@openzeppelin/contracts-upgradeable": ^4.8.0 - "@venusprotocol/governance-contracts": ^1.4.0-dev.1 - "@venusprotocol/protocol-reserve": ^1.1.0 - bignumber.js: ^9.1.2 - dotenv: ^16.0.1 - module-alias: ^2.2.2 - checksum: 2e819a464626233c24e566be21438f120378b617289e9646024b47859dc6fc7cb785c3af5e6b04fc1fe9a78aac73b98cb51014c48910db93ba6e4b9ff397c17e - languageName: node - linkType: hard - "@venusprotocol/venus-protocol@npm:^9.1.0": version: 9.1.0 resolution: "@venusprotocol/venus-protocol@npm:9.1.0" @@ -7649,6 +7603,73 @@ __metadata: languageName: node linkType: hard +"hardhat@npm:2.19.5": + version: 2.19.5 + resolution: "hardhat@npm:2.19.5" + dependencies: + "@ethersproject/abi": ^5.1.2 + "@metamask/eth-sig-util": ^4.0.0 + "@nomicfoundation/ethereumjs-block": 5.0.2 + "@nomicfoundation/ethereumjs-blockchain": 7.0.2 + "@nomicfoundation/ethereumjs-common": 4.0.2 + "@nomicfoundation/ethereumjs-evm": 2.0.2 + "@nomicfoundation/ethereumjs-rlp": 5.0.2 + "@nomicfoundation/ethereumjs-statemanager": 2.0.2 + "@nomicfoundation/ethereumjs-trie": 6.0.2 + "@nomicfoundation/ethereumjs-tx": 5.0.2 + "@nomicfoundation/ethereumjs-util": 9.0.2 + "@nomicfoundation/ethereumjs-vm": 7.0.2 + "@nomicfoundation/solidity-analyzer": ^0.1.0 + "@sentry/node": ^5.18.1 + "@types/bn.js": ^5.1.0 + "@types/lru-cache": ^5.1.0 + adm-zip: ^0.4.16 + aggregate-error: ^3.0.0 + ansi-escapes: ^4.3.0 + boxen: ^5.1.2 + chalk: ^2.4.2 + chokidar: ^3.4.0 + ci-info: ^2.0.0 + debug: ^4.1.1 + enquirer: ^2.3.0 + env-paths: ^2.2.0 + ethereum-cryptography: ^1.0.3 + ethereumjs-abi: ^0.6.8 + find-up: ^2.1.0 + fp-ts: 1.19.3 + fs-extra: ^7.0.1 + glob: 7.2.0 + immutable: ^4.0.0-rc.12 + io-ts: 1.10.4 + keccak: ^3.0.2 + lodash: ^4.17.11 + mnemonist: ^0.38.0 + mocha: ^10.0.0 + p-map: ^4.0.0 + raw-body: ^2.4.1 + resolve: 1.17.0 + semver: ^6.3.0 + solc: 0.7.3 + source-map-support: ^0.5.13 + stacktrace-parser: ^0.1.10 + tsort: 0.0.1 + undici: ^5.14.0 + uuid: ^8.3.2 + ws: ^7.4.6 + peerDependencies: + ts-node: "*" + typescript: "*" + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + bin: + hardhat: internal/cli/bootstrap.js + checksum: 316b03a1d090360e6ed471fe125360ec0c66c5bb62e29492898932b1a9a5227c12d7a18343877c59725f321647a01fde0841649bf7d8a4a746148a0d38b0ee27 + languageName: node + linkType: hard + "hardhat@npm:^2.14.0": version: 2.22.6 resolution: "hardhat@npm:2.22.6" From 8c0bee9d0bf2d000c44c9168ba09638b006bcd29 Mon Sep 17 00:00:00 2001 From: Venus Tools Date: Tue, 3 Dec 2024 13:02:31 +0000 Subject: [PATCH 20/24] chore(release): 3.0.0-dev.3 [skip ci] ## [3.0.0-dev.3](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.2...v3.0.0-dev.3) (2024-12-03) ### Features * updating deployment files ([53b1670](https://github.com/VenusProtocol/protocol-reserve/commit/53b1670a3d4c4fa4c1116c7e80aa4b7bf0eb5a12)) ### Bug Fixes * added config ([1ce0e03](https://github.com/VenusProtocol/protocol-reserve/commit/1ce0e0348b46faa7cce571d6e62ad128a6aaf2d0)) * deployed contracts ([f16af29](https://github.com/VenusProtocol/protocol-reserve/commit/f16af2929254311f00c06adb80c7d39cda48fe0b)) --- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac08c607..dd961465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [3.0.0-dev.3](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.2...v3.0.0-dev.3) (2024-12-03) + + +### Features + +* updating deployment files ([53b1670](https://github.com/VenusProtocol/protocol-reserve/commit/53b1670a3d4c4fa4c1116c7e80aa4b7bf0eb5a12)) + + +### Bug Fixes + +* added config ([1ce0e03](https://github.com/VenusProtocol/protocol-reserve/commit/1ce0e0348b46faa7cce571d6e62ad128a6aaf2d0)) +* deployed contracts ([f16af29](https://github.com/VenusProtocol/protocol-reserve/commit/f16af2929254311f00c06adb80c7d39cda48fe0b)) + ## [3.0.0-dev.2](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.1...v3.0.0-dev.2) (2024-11-27) diff --git a/package.json b/package.json index 19757e97..6e044a1f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@venusprotocol/protocol-reserve", "description": "Venus Protocol contracts to manage the income generated by the protocol", - "version": "3.0.0-dev.2", + "version": "3.0.0-dev.3", "author": "Venus", "engines": { "node": ">=18.0.0" From c7f7b649ca9e31f253150bc1bdd9d35451e7da20 Mon Sep 17 00:00:00 2001 From: Narayan Prusty Date: Fri, 6 Dec 2024 15:31:06 +0530 Subject: [PATCH 21/24] feat: deployed on base mainnet --- .env.example | 1 + .github/workflows/ci.yml | 2 +- deployments/basemainnet/.chainId | 1 + .../basemainnet/DefaultProxyAdmin.json | 200 +++ .../basemainnet/ProtocolShareReserve.json | 1059 ++++++++++++++ .../ProtocolShareReserve_Implementation.json | 1285 +++++++++++++++++ .../ProtocolShareReserve_Proxy.json | 277 ++++ .../0e89febeebc7444140de8e67c9067d2c.json | 78 + .../af615647fec601102c25fd7b3b76f11e.json | 280 ++++ hardhat.config.ts | 15 + helpers/utils.ts | 1 + 11 files changed, 3198 insertions(+), 1 deletion(-) create mode 100644 deployments/basemainnet/.chainId create mode 100644 deployments/basemainnet/DefaultProxyAdmin.json create mode 100644 deployments/basemainnet/ProtocolShareReserve.json create mode 100644 deployments/basemainnet/ProtocolShareReserve_Implementation.json create mode 100644 deployments/basemainnet/ProtocolShareReserve_Proxy.json create mode 100644 deployments/basemainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json create mode 100644 deployments/basemainnet/solcInputs/af615647fec601102c25fd7b3b76f11e.json diff --git a/.env.example b/.env.example index b9857022..9f530060 100644 --- a/.env.example +++ b/.env.example @@ -21,6 +21,7 @@ DEPLOYER_PRIVATE_KEY= #ARCHIVE_NODE_opsepolia=https://sepolia.optimism.io #ARCHIVE_NODE_opmainnet=https://opt-mainnet.nodereal.io/v1/ #ARCHIVE_NODE_basesepolia=https://base-sepolia.blastapi.io/ +#ARCHIVE_NODE_basemainnet=https://open-platform.nodereal.io//base ETHERSCAN_API_KEY= REPORT_GAS= \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a74f83a0..fc0c7526 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: - name: Export deployments run: | - for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia; do + for NETWORK in bsctestnet bscmainnet ethereum sepolia opbnbmainnet opbnbtestnet arbitrumsepolia arbitrumone opsepolia opmainnet basesepolia basemainnet; do EXPORT=true yarn hardhat export --network ${NETWORK} --export ./deployments/${NETWORK}.json jq -M '{name, chainId, addresses: .contracts | map_values(.address)}' ./deployments/${NETWORK}.json > ./deployments/${NETWORK}_addresses.json done diff --git a/deployments/basemainnet/.chainId b/deployments/basemainnet/.chainId new file mode 100644 index 00000000..2a0c2638 --- /dev/null +++ b/deployments/basemainnet/.chainId @@ -0,0 +1 @@ +8453 \ No newline at end of file diff --git a/deployments/basemainnet/DefaultProxyAdmin.json b/deployments/basemainnet/DefaultProxyAdmin.json new file mode 100644 index 00000000..3153f779 --- /dev/null +++ b/deployments/basemainnet/DefaultProxyAdmin.json @@ -0,0 +1,200 @@ +{ + "address": "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x6300ec0a1b21ebcff7b500b5a0f65145d9156081674fdf24cef6e42a7ef923e0", + "receipt": { + "to": null, + "from": "0xdB7a865041d965f575CAB277783fF490508A21F3", + "contractAddress": "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "transactionIndex": 103, + "gasUsed": "473314", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000001010000000400000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000020000000000000000004000000000000000000000000000000000000000000000000", + "blockHash": "0x8d402d72a218d0cc48d255adcc2e1d86ebe025f61ec4eb2fbfe7170458ed605b", + "transactionHash": "0x6300ec0a1b21ebcff7b500b5a0f65145d9156081674fdf24cef6e42a7ef923e0", + "logs": [ + { + "transactionIndex": 103, + "blockNumber": 23213779, + "transactionHash": "0x6300ec0a1b21ebcff7b500b5a0f65145d9156081674fdf24cef6e42a7ef923e0", + "address": "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000001803cf1d3495b43cc628aa1d8638a981f8cd341c" + ], + "data": "0x", + "logIndex": 336, + "blockHash": "0x8d402d72a218d0cc48d255adcc2e1d86ebe025f61ec4eb2fbfe7170458ed605b" + } + ], + "blockNumber": 23213779, + "cumulativeGasUsed": "16379446", + "status": 1, + "byzantium": true + }, + "args": ["0x1803Cf1D3495b43cC628aa1d8638A981F8CD341C"], + "numDeployments": 1, + "bytecode": "0x6080604052348015600f57600080fd5b506040516107e43803806107e4833981016040819052602c91608a565b80603481603a565b505060b8565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215609b57600080fd5b81516001600160a01b038116811460b157600080fd5b9392505050565b61071d806100c76000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104ed565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610511565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f366004610560565b6102de565b34801561013057600080fd5b506100d161013f366004610511565b61036f565b34801561015057600080fd5b506100d161015f3660046104ed565b6103c7565b34801561017057600080fd5b506100a061017f3660046104ed565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610636565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610653565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610653565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610653565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610688565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610653565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610653565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461045f57600080fd5b6000602082840312156104ff57600080fd5b813561050a816104d8565b9392505050565b6000806040838503121561052457600080fd5b823561052f816104d8565b9150602083013561053f816104d8565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561057557600080fd5b8335610580816104d8565b92506020840135610590816104d8565b9150604084013567ffffffffffffffff808211156105ad57600080fd5b818601915086601f8301126105c157600080fd5b8135818111156105d3576105d361054a565b604051601f8201601f19908116603f011681019083821181831017156105fb576105fb61054a565b8160405282815289602084870101111561061457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561064857600080fd5b815161050a816104d8565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b03831681526000602060406020840152835180604085015260005b818110156106c5578581018301518582016060015282016106a9565b506000606082860101526060601f19601f83011685010192505050939250505056fea264697066735822122030f52ef7e16587f148a9f5ca0dbcadc434f9288a9162f8ab87307aa33db8fc4364736f6c63430008190033", + "deployedBytecode": "0x60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104ed565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610511565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f366004610560565b6102de565b34801561013057600080fd5b506100d161013f366004610511565b61036f565b34801561015057600080fd5b506100d161015f3660046104ed565b6103c7565b34801561017057600080fd5b506100a061017f3660046104ed565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d9190610636565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610653565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610653565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610653565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610688565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610653565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610653565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461045f57600080fd5b6000602082840312156104ff57600080fd5b813561050a816104d8565b9392505050565b6000806040838503121561052457600080fd5b823561052f816104d8565b9150602083013561053f816104d8565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561057557600080fd5b8335610580816104d8565b92506020840135610590816104d8565b9150604084013567ffffffffffffffff808211156105ad57600080fd5b818601915086601f8301126105c157600080fd5b8135818111156105d3576105d361054a565b604051601f8201601f19908116603f011681019083821181831017156105fb576105fb61054a565b8160405282815289602084870101111561061457600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561064857600080fd5b815161050a816104d8565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60018060a01b03831681526000602060406020840152835180604085015260005b818110156106c5578581018301518582016060015282016106a9565b506000606082860101526060601f19601f83011685010192505050939250505056fea264697066735822122030f52ef7e16587f148a9f5ca0dbcadc434f9288a9162f8ab87307aa33db8fc4364736f6c63430008190033" +} diff --git a/deployments/basemainnet/ProtocolShareReserve.json b/deployments/basemainnet/ProtocolShareReserve.json new file mode 100644 index 00000000..296ebee8 --- /dev/null +++ b/deployments/basemainnet/ProtocolShareReserve.json @@ -0,0 +1,1059 @@ +{ + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ], + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "receipt": { + "to": null, + "from": "0xdB7a865041d965f575CAB277783fF490508A21F3", + "contractAddress": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "transactionIndex": 60, + "gasUsed": "843177", + "logsBloom": "0x00000000000000000800000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000100000008000800000000000000000000000000002000001000000000000000000000010000000000000021000000000000000000800000000800000000000000000000000400000000000010000000000000000000000000000000080000000000000800000000000000000000000002000000400000000000000800000000000000000000000000020000000000000000001040000000000000400000000000000000020000000000200000000000001000000000000000800000400000000000000000000", + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9", + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "logs": [ + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000008991cc6b4494b71621f5a4f6633695f896fd37ee" + ], + "data": "0x", + "logIndex": 213, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000db7a865041d965f575cab277783ff490508a21f3" + ], + "data": "0x", + "logIndex": 214, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000009e6ceefdc6183e4d0df8092a9b90cdf659687dab", + "logIndex": 215, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 216, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 217, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b06ef6b68648c61afe0f715740fe3950b90746b", + "logIndex": 218, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + } + ], + "blockNumber": 23344921, + "cumulativeGasUsed": "13256778", + "status": 1, + "byzantium": true + }, + "args": [ + "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "0xcd6dc6870000000000000000000000009e6ceefdc6183e4d0df8092a9b90cdf659687dab0000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "execute": { + "methodName": "initialize", + "args": ["0x9E6CeEfDC6183e4D0DF8092A9B90cDF659687daB", 20] + }, + "implementation": "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/basemainnet/ProtocolShareReserve_Implementation.json b/deployments/basemainnet/ProtocolShareReserve_Implementation.json new file mode 100644 index 00000000..836618d0 --- /dev/null +++ b/deployments/basemainnet/ProtocolShareReserve_Implementation.json @@ -0,0 +1,1285 @@ +{ + "address": "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_corePoolComptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "_wbnb", + "type": "address" + }, + { + "internalType": "address", + "name": "_vbnb", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0xad997cce683e5ad3096b741118421defebdfd335fcacd0b5dee8957d01242967", + "receipt": { + "to": null, + "from": "0xdB7a865041d965f575CAB277783fF490508A21F3", + "contractAddress": "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "transactionIndex": 68, + "gasUsed": "2574496", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000004001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xec721371b05a966d4af9bfb5ec64df94c260d39a524eae8e86c9083362dd84ab", + "transactionHash": "0xad997cce683e5ad3096b741118421defebdfd335fcacd0b5dee8957d01242967", + "logs": [ + { + "transactionIndex": 68, + "blockNumber": 23344918, + "transactionHash": "0xad997cce683e5ad3096b741118421defebdfd335fcacd0b5dee8957d01242967", + "address": "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", + "logIndex": 226, + "blockHash": "0xec721371b05a966d4af9bfb5ec64df94c260d39a524eae8e86c9083362dd84ab" + } + ], + "blockNumber": 23344918, + "cumulativeGasUsed": "17430704", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000001", + "0x0000000000000000000000000000000000000001" + ], + "numDeployments": 1, + "solcInputHash": "af615647fec601102c25fd7b3b76f11e", + "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_corePoolComptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wbnb\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vbnb\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTotalPercentage\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"loopsLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requiredLoops\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"calledContract\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"methodSignature\",\"type\":\"string\"}],\"name\":\"Unauthorized\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddressNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"percent\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"AssetReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"enum IProtocolShareReserve.IncomeType\",\"name\":\"incomeType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"AssetsReservesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"DistributionConfigAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"DistributionConfigRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"oldPercentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"newPercentage\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"DistributionConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldMaxLoopsLimit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newmaxLoopsLimit\",\"type\":\"uint256\"}],\"name\":\"MaxLoopsLimitUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldAccessControlManager\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAccessControlManager\",\"type\":\"address\"}],\"name\":\"NewAccessControlManager\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oldPoolRegistry\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPoolRegistry\",\"type\":\"address\"}],\"name\":\"PoolRegistryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"ReservesUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"CORE_POOL_COMPTROLLER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_PERCENT\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"WBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"accessControlManager\",\"outputs\":[{\"internalType\":\"contract IAccessControlManagerV8\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct ProtocolShareReserve.DistributionConfig[]\",\"name\":\"configs\",\"type\":\"tuple[]\"}],\"name\":\"addOrUpdateDistributionConfigs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"\",\"type\":\"uint8\"}],\"name\":\"assetsReserves\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"distributionTargets\",\"outputs\":[{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"uint16\",\"name\":\"percentage\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"}],\"name\":\"getPercentageDistribution\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getUnreleasedFunds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_accessControlManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_loopsLimit\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLoopsLimit\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"poolRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"assets\",\"type\":\"address[]\"}],\"name\":\"releaseFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"enum ProtocolShareReserve.Schema\",\"name\":\"schema\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"removeDistributionConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"accessControlManager_\",\"type\":\"address\"}],\"name\":\"setAccessControlManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_poolRegistry\",\"type\":\"address\"}],\"name\":\"setPoolRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"totalAssetReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalDistributions\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"comptroller\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"enum IProtocolShareReserve.IncomeType\",\"name\":\"incomeType\",\"type\":\"uint8\"}],\"name\":\"updateAssetsState\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vBNB\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Initialized(uint8)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"}},\"kind\":\"dev\",\"methods\":{\"acceptOwnership()\":{\"details\":\"The new owner accepts the ownership transfer.\"},\"addOrUpdateDistributionConfigs((uint8,uint16,address)[])\":{\"details\":\"Add or update destination targets based on destination address\",\"params\":{\"configs\":\"configurations of the destinations.\"}},\"constructor\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor\"},\"getPercentageDistribution(address,uint8)\":{\"details\":\"Used to find out the percentage distribution for a particular destination based on schema\",\"params\":{\"destination\":\"the destination address of the distribution target\",\"schema\":\"the schema of the distribution target\"},\"returns\":{\"_0\":\"percentage percentage distribution\"}},\"getUnreleasedFunds(address,uint8,address,address)\":{\"details\":\"Used to find out the amount of funds that's going to be released when release funds is called.\",\"params\":{\"asset\":\"the asset address which will be released\",\"comptroller\":\"the comptroller address of the pool\",\"destination\":\"the destination address of the distribution target\",\"schema\":\"the schema of the distribution target\"}},\"initialize(address,uint256)\":{\"details\":\"Initializes the deployer to owner.\",\"params\":{\"_accessControlManager\":\"The address of ACM contract\",\"_loopsLimit\":\"Limit for the loops in the contract to avoid DOS\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pendingOwner()\":{\"details\":\"Returns the address of the pending owner.\"},\"releaseFunds(address,address[])\":{\"details\":\"Release funds\",\"params\":{\"assets\":\"assets to be released to distribution targets\",\"comptroller\":\"the comptroller address of the pool\"}},\"removeDistributionConfig(uint8,address)\":{\"details\":\"Remove destionation target if percentage is 0\",\"params\":{\"destination\":\"destination address of the configuration\",\"schema\":\"schema of the configuration\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"setAccessControlManager(address)\":{\"custom:access\":\"Only Governance\",\"custom:event\":\"Emits NewAccessControlManager event\",\"details\":\"Admin function to set address of AccessControlManager\",\"params\":{\"accessControlManager_\":\"The new address of the AccessControlManager\"}},\"setPoolRegistry(address)\":{\"custom:error\":\"ZeroAddressNotAllowed is thrown when pool registry address is zero\",\"details\":\"Pool registry setter.\",\"params\":{\"_poolRegistry\":\"Address of the pool registry\"}},\"totalDistributions()\":{\"details\":\"Returns the total number of distribution targets\"},\"transferOwnership(address)\":{\"details\":\"Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.\"},\"updateAssetsState(address,address,uint8)\":{\"details\":\"Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\",\"params\":{\"asset\":\"Asset address.\",\"comptroller\":\"Comptroller address (pool)\",\"incomeType\":\"type of income\"}}},\"stateVariables\":{\"CORE_POOL_COMPTROLLER\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"WBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"},\"vBNB\":{\"custom:oz-upgrades-unsafe-allow\":\"state-variable-immutable\"}},\"version\":1},\"userdoc\":{\"errors\":{\"MaxLoopsLimitExceeded(uint256,uint256)\":[{\"notice\":\"Thrown an error on maxLoopsLimit exceeds for any loop\"}],\"Unauthorized(address,address,string)\":[{\"notice\":\"Thrown when the action is prohibited by AccessControlManager\"}],\"ZeroAddressNotAllowed()\":[{\"notice\":\"Thrown if the supplied address is a zero address where it is not allowed\"}]},\"events\":{\"AssetReleased(address,address,uint8,uint256,uint256)\":{\"notice\":\"Event emitted when an asset is released to a target\"},\"AssetsReservesUpdated(address,address,uint256,uint8,uint8)\":{\"notice\":\"Event emitted after updating of the assets reserves.\"},\"DistributionConfigAdded(address,uint16,uint8)\":{\"notice\":\"Event emitted when distribution configuration is added\"},\"DistributionConfigRemoved(address,uint16,uint8)\":{\"notice\":\"Event emitted when distribution configuration is removed\"},\"DistributionConfigUpdated(address,uint16,uint16,uint8)\":{\"notice\":\"Event emitted when distribution configuration is updated\"},\"MaxLoopsLimitUpdated(uint256,uint256)\":{\"notice\":\"Emitted when max loops limit is set\"},\"NewAccessControlManager(address,address)\":{\"notice\":\"Emitted when access control manager contract address is changed\"},\"PoolRegistryUpdated(address,address)\":{\"notice\":\"Emitted when pool registry address is updated\"},\"ReservesUpdated(address,address,uint8,uint256,uint256)\":{\"notice\":\"Event emitted when asset reserves state is updated\"}},\"kind\":\"user\",\"methods\":{\"CORE_POOL_COMPTROLLER()\":{\"notice\":\"address of core pool comptroller contract\"},\"WBNB()\":{\"notice\":\"address of WBNB contract\"},\"accessControlManager()\":{\"notice\":\"Returns the address of the access control manager contract\"},\"assetsReserves(address,address,uint8)\":{\"notice\":\"comptroller => asset => schema => balance\"},\"distributionTargets(uint256)\":{\"notice\":\"configuration for different income distribution targets\"},\"poolRegistry()\":{\"notice\":\"address of pool registry contract\"},\"setAccessControlManager(address)\":{\"notice\":\"Sets the address of AccessControlManager\"},\"totalAssetReserve(address)\":{\"notice\":\"asset => balance\"},\"vBNB()\":{\"notice\":\"address of vBNB contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/ProtocolReserve/ProtocolShareReserve.sol\":\"ProtocolShareReserve\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./OwnableUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership} and {acceptOwnership}.\\n *\\n * This module is used through inheritance. It will make available all functions\\n * from parent (Ownable).\\n */\\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\\n function __Ownable2Step_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable2Step_init_unchained() internal onlyInitializing {\\n }\\n address private _pendingOwner;\\n\\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Returns the address of the pending owner.\\n */\\n function pendingOwner() public view virtual returns (address) {\\n return _pendingOwner;\\n }\\n\\n /**\\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual override onlyOwner {\\n _pendingOwner = newOwner;\\n emit OwnershipTransferStarted(owner(), newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual override {\\n delete _pendingOwner;\\n super._transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev The new owner accepts the ownership transfer.\\n */\\n function acceptOwnership() public virtual {\\n address sender = _msgSender();\\n require(pendingOwner() == sender, \\\"Ownable2Step: caller is not the new owner\\\");\\n _transferOwnership(sender);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x84efb8889801b0ac817324aff6acc691d07bbee816b671817132911d287a8c63\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n function __Ownable_init() internal onlyInitializing {\\n __Ownable_init_unchained();\\n }\\n\\n function __Ownable_init_unchained() internal onlyInitializing {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x4075622496acc77fd6d4de4cc30a8577a744d5c75afad33fdeacf1704d6eda98\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n function __ReentrancyGuard_init() internal onlyInitializing {\\n __ReentrancyGuard_init_unchained();\\n }\\n\\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb82ef33f43b6b96109687d91b39c94573fdccaaa423fe28e8ba0977b31c023e0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\\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\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\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 cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\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 * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n function __Context_init() internal onlyInitializing {\\n }\\n\\n function __Context_init_unchained() internal onlyInitializing {\\n }\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\\\";\\n\\nimport \\\"./IAccessControlManagerV8.sol\\\";\\n\\n/**\\n * @title AccessControlledV8\\n * @author Venus\\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\\n */\\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\\n /// @notice Access control manager contract\\n IAccessControlManagerV8 private _accessControlManager;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when access control manager contract address is changed\\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\\n\\n /// @notice Thrown when the action is prohibited by AccessControlManager\\n error Unauthorized(address sender, address calledContract, string methodSignature);\\n\\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\\n __Ownable2Step_init();\\n __AccessControlled_init_unchained(accessControlManager_);\\n }\\n\\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Sets the address of AccessControlManager\\n * @dev Admin function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n * @custom:event Emits NewAccessControlManager event\\n * @custom:access Only Governance\\n */\\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\\n _setAccessControlManager(accessControlManager_);\\n }\\n\\n /**\\n * @notice Returns the address of the access control manager contract\\n */\\n function accessControlManager() external view returns (IAccessControlManagerV8) {\\n return _accessControlManager;\\n }\\n\\n /**\\n * @dev Internal function to set address of AccessControlManager\\n * @param accessControlManager_ The new address of the AccessControlManager\\n */\\n function _setAccessControlManager(address accessControlManager_) internal {\\n require(address(accessControlManager_) != address(0), \\\"invalid acess control manager address\\\");\\n address oldAccessControlManager = address(_accessControlManager);\\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\\n }\\n\\n /**\\n * @notice Reverts if the call is not allowed by AccessControlManager\\n * @param signature Method signature\\n */\\n function _checkAccessAllowed(string memory signature) internal view {\\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\\n\\n if (!isAllowedToCall) {\\n revert Unauthorized(msg.sender, address(this), signature);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0dcf283925f4dddc23ca0ee71d2cb96a9dd6e4cf08061b69fde1697ea39dc514\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\nimport \\\"@openzeppelin/contracts/access/IAccessControl.sol\\\";\\n\\n/**\\n * @title IAccessControlManagerV8\\n * @author Venus\\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\\n */\\ninterface IAccessControlManagerV8 is IAccessControl {\\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\\n\\n function revokeCallPermission(\\n address contractAddress,\\n string calldata functionSig,\\n address accountToRevoke\\n ) external;\\n\\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\\n\\n function hasPermission(\\n address account,\\n address contractAddress,\\n string calldata functionSig\\n ) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xaa29b098440d0b3a131c5ecdf25ce548790c1b5ac7bf9b5c0264b6af6f7a1e0b\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/**\\n * @title MaxLoopsLimitHelper\\n * @author Venus\\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\\n */\\nabstract contract MaxLoopsLimitHelper {\\n // Limit for the loops to avoid the DOS\\n uint256 public maxLoopsLimit;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain.\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[49] private __gap;\\n\\n /// @notice Emitted when max loops limit is set\\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\\n\\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\\n\\n /**\\n * @notice Set the limit for the loops can iterate to avoid the DOS\\n * @param limit Limit for the max loops can execute at a time\\n */\\n function _setMaxLoopsLimit(uint256 limit) internal {\\n require(limit > maxLoopsLimit, \\\"Comptroller: Invalid maxLoopsLimit\\\");\\n\\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\\n maxLoopsLimit = limit;\\n\\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\\n }\\n\\n /**\\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\\n * @param len Length of the loops iterate\\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\\n */\\n function _ensureMaxLoops(uint256 len) internal view {\\n if (len > maxLoopsLimit) {\\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4c25e30635485d162177effa384eee51768b0141a567a0da16ff6ad673274166\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/validators.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\\nerror ZeroAddressNotAllowed();\\n\\n/// @notice Thrown if the supplied value is 0 where it is not allowed\\nerror ZeroValueNotAllowed();\\n\\n/// @notice Checks if the provided address is nonzero, reverts otherwise\\n/// @param address_ Address to check\\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\\nfunction ensureNonzeroAddress(address address_) pure {\\n if (address_ == address(0)) {\\n revert ZeroAddressNotAllowed();\\n }\\n}\\n\\n/// @notice Checks if the provided value is nonzero, reverts otherwise\\n/// @param value_ Value to check\\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\\nfunction ensureNonzeroValue(uint256 value_) pure {\\n if (value_ == 0) {\\n revert ZeroValueNotAllowed();\\n }\\n}\\n\",\"keccak256\":\"0xdb88e14d50dd21889ca3329d755673d022c47e8da005b6a545c7f69c2c4b7b86\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IComptroller.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IComptroller {\\n function isComptroller() external view returns (bool);\\n\\n function markets(address) external view returns (bool);\\n\\n function getAllMarkets() external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xeeb8e8d4c749f6aa69cd7740161bc5f4e802199b147ce98961d742aa1bbaf3bf\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IIncomeDestination.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IIncomeDestination {\\n function updateAssetsState(address comptroller, address asset) external;\\n}\\n\",\"keccak256\":\"0x421edd67af6a7c5edcf321e64ea6a56b5cadbbd7ff4b7faf8b2a70891800584b\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IPoolRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IPoolRegistry {\\n /// @notice Get VToken in the Pool for an Asset\\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\\n\\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\\n}\\n\",\"keccak256\":\"0xf92fa4b736309b63de1e9a4025e9d471b2bff34c00a4c0e37193a1d109fd36d4\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IProtocolShareReserve.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IProtocolShareReserve {\\n /// @notice it represents the type of vToken income\\n enum IncomeType {\\n SPREAD,\\n LIQUIDATION\\n }\\n\\n function updateAssetsState(\\n address comptroller,\\n address asset,\\n IncomeType incomeType\\n ) external;\\n}\\n\",\"keccak256\":\"0x5fddc5b63fdd850b3b5c83576cda50dcb27a205dbb1a23af17d9da0d9f04fa0a\",\"license\":\"BSD-3-Clause\"},\"contracts/Interfaces/IVToken.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\ninterface IVToken {\\n function underlying() external view returns (address);\\n}\\n\",\"keccak256\":\"0x2d10d295f7f5d2288840dd20e752eb9a997603af7fbc14f0770174591b5fa5d7\",\"license\":\"BSD-3-Clause\"},\"contracts/ProtocolReserve/ProtocolShareReserve.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SafeERC20Upgradeable, IERC20Upgradeable } from \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport { AccessControlledV8 } from \\\"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\\\";\\nimport { ReentrancyGuardUpgradeable } from \\\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\\\";\\nimport { MaxLoopsLimitHelper } from \\\"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\\\";\\nimport { ensureNonzeroAddress } from \\\"@venusprotocol/solidity-utilities/contracts/validators.sol\\\";\\n\\nimport { IProtocolShareReserve } from \\\"../Interfaces/IProtocolShareReserve.sol\\\";\\nimport { IComptroller } from \\\"../Interfaces/IComptroller.sol\\\";\\nimport { IPoolRegistry } from \\\"../Interfaces/IPoolRegistry.sol\\\";\\nimport { IVToken } from \\\"../Interfaces/IVToken.sol\\\";\\nimport { IIncomeDestination } from \\\"../Interfaces/IIncomeDestination.sol\\\";\\n\\nerror InvalidAddress();\\nerror UnsupportedAsset();\\nerror InvalidTotalPercentage();\\nerror InvalidMaxLoopsLimit();\\n\\ncontract ProtocolShareReserve is\\n AccessControlledV8,\\n ReentrancyGuardUpgradeable,\\n MaxLoopsLimitHelper,\\n IProtocolShareReserve\\n{\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n /// @notice protocol income is categorized into two schemas.\\n /// The first schema is for spread income\\n /// The second schema is for liquidation income\\n enum Schema {\\n PROTOCOL_RESERVES,\\n ADDITIONAL_REVENUE\\n }\\n\\n struct DistributionConfig {\\n Schema schema;\\n /// @dev percenatge is represented without any scale\\n uint16 percentage;\\n address destination;\\n }\\n\\n /// @notice address of core pool comptroller contract\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable CORE_POOL_COMPTROLLER;\\n\\n /// @notice address of WBNB contract\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable WBNB;\\n\\n /// @notice address of vBNB contract\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n address public immutable vBNB;\\n\\n /// @notice address of pool registry contract\\n address public poolRegistry;\\n\\n uint16 public constant MAX_PERCENT = 1e4;\\n\\n /// @notice comptroller => asset => schema => balance\\n mapping(address => mapping(address => mapping(Schema => uint256))) public assetsReserves;\\n\\n /// @notice asset => balance\\n mapping(address => uint256) public totalAssetReserve;\\n\\n /// @notice configuration for different income distribution targets\\n DistributionConfig[] public distributionTargets;\\n\\n /// @notice Emitted when pool registry address is updated\\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\\n\\n /// @notice Event emitted after updating of the assets reserves.\\n event AssetsReservesUpdated(\\n address indexed comptroller,\\n address indexed asset,\\n uint256 amount,\\n IncomeType incomeType,\\n Schema schema\\n );\\n\\n /// @notice Event emitted when an asset is released to a target\\n event AssetReleased(\\n address indexed destination,\\n address indexed asset,\\n Schema schema,\\n uint256 percent,\\n uint256 amount\\n );\\n\\n /// @notice Event emitted when asset reserves state is updated\\n event ReservesUpdated(\\n address indexed comptroller,\\n address indexed asset,\\n Schema schema,\\n uint256 oldBalance,\\n uint256 newBalance\\n );\\n\\n /// @notice Event emitted when distribution configuration is updated\\n event DistributionConfigUpdated(\\n address indexed destination,\\n uint16 oldPercentage,\\n uint16 newPercentage,\\n Schema schema\\n );\\n\\n /// @notice Event emitted when distribution configuration is added\\n event DistributionConfigAdded(address indexed destination, uint16 percentage, Schema schema);\\n\\n /// @notice Event emitted when distribution configuration is removed\\n event DistributionConfigRemoved(address indexed destination, uint16 percentage, Schema schema);\\n\\n /**\\n * @dev Constructor to initialize the immutable variables\\n * @param _corePoolComptroller The address of core pool comptroller\\n * @param _wbnb The address of WBNB\\n * @param _vbnb The address of vBNB\\n */\\n /// @custom:oz-upgrades-unsafe-allow constructor\\n constructor(\\n address _corePoolComptroller,\\n address _wbnb,\\n address _vbnb\\n ) {\\n ensureNonzeroAddress(_corePoolComptroller);\\n ensureNonzeroAddress(_wbnb);\\n ensureNonzeroAddress(_vbnb);\\n\\n CORE_POOL_COMPTROLLER = _corePoolComptroller;\\n WBNB = _wbnb;\\n vBNB = _vbnb;\\n\\n // Note that the contract is upgradeable. Use initialize() or reinitializers\\n // to set the state variables.\\n _disableInitializers();\\n }\\n\\n /**\\n * @dev Initializes the deployer to owner.\\n * @param _accessControlManager The address of ACM contract\\n * @param _loopsLimit Limit for the loops in the contract to avoid DOS\\n */\\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\\n __AccessControlled_init(_accessControlManager);\\n __ReentrancyGuard_init();\\n _setMaxLoopsLimit(_loopsLimit);\\n }\\n\\n /**\\n * @dev Pool registry setter.\\n * @param _poolRegistry Address of the pool registry\\n * @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\\n */\\n function setPoolRegistry(address _poolRegistry) external onlyOwner {\\n ensureNonzeroAddress(_poolRegistry);\\n emit PoolRegistryUpdated(poolRegistry, _poolRegistry);\\n poolRegistry = _poolRegistry;\\n }\\n\\n /**\\n * @dev Add or update destination targets based on destination address\\n * @param configs configurations of the destinations.\\n */\\n function addOrUpdateDistributionConfigs(DistributionConfig[] calldata configs) external nonReentrant {\\n _checkAccessAllowed(\\\"addOrUpdateDistributionConfigs(DistributionConfig[])\\\");\\n\\n for (uint256 i = 0; i < configs.length; ) {\\n DistributionConfig memory _config = configs[i];\\n ensureNonzeroAddress(_config.destination);\\n\\n bool updated = false;\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 j = 0; j < distributionTargetsLength; ) {\\n DistributionConfig storage config = distributionTargets[j];\\n\\n if (_config.schema == config.schema && config.destination == _config.destination) {\\n emit DistributionConfigUpdated(\\n _config.destination,\\n config.percentage,\\n _config.percentage,\\n _config.schema\\n );\\n config.percentage = _config.percentage;\\n updated = true;\\n break;\\n }\\n\\n unchecked {\\n ++j;\\n }\\n }\\n\\n if (!updated) {\\n distributionTargets.push(_config);\\n emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n _ensurePercentages();\\n _ensureMaxLoops(distributionTargets.length);\\n }\\n\\n /**\\n * @dev Remove destionation target if percentage is 0\\n * @param schema schema of the configuration\\n * @param destination destination address of the configuration\\n */\\n function removeDistributionConfig(Schema schema, address destination) external {\\n _checkAccessAllowed(\\\"removeDistributionConfig(Schema,address)\\\");\\n\\n uint256 distributionIndex;\\n bool found = false;\\n for (uint256 i = 0; i < distributionTargets.length; ) {\\n DistributionConfig storage config = distributionTargets[i];\\n\\n if (schema == config.schema && destination == config.destination && config.percentage == 0) {\\n found = true;\\n distributionIndex = i;\\n break;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n if (found) {\\n emit DistributionConfigRemoved(\\n distributionTargets[distributionIndex].destination,\\n distributionTargets[distributionIndex].percentage,\\n distributionTargets[distributionIndex].schema\\n );\\n\\n distributionTargets[distributionIndex] = distributionTargets[distributionTargets.length - 1];\\n distributionTargets.pop();\\n }\\n\\n _ensurePercentages();\\n }\\n\\n /**\\n * @dev Release funds\\n * @param comptroller the comptroller address of the pool\\n * @param assets assets to be released to distribution targets\\n */\\n function releaseFunds(address comptroller, address[] calldata assets) external nonReentrant {\\n for (uint256 i = 0; i < assets.length; ) {\\n _releaseFund(comptroller, assets[i]);\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Used to find out the amount of funds that's going to be released when release funds is called.\\n * @param comptroller the comptroller address of the pool\\n * @param schema the schema of the distribution target\\n * @param destination the destination address of the distribution target\\n * @param asset the asset address which will be released\\n */\\n function getUnreleasedFunds(\\n address comptroller,\\n Schema schema,\\n address destination,\\n address asset\\n ) external view returns (uint256) {\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 i = 0; i < distributionTargetsLength; ) {\\n DistributionConfig storage _config = distributionTargets[i];\\n if (_config.schema == schema && _config.destination == destination) {\\n uint256 total = assetsReserves[comptroller][asset][schema];\\n return (total * _config.percentage) / MAX_PERCENT;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the total number of distribution targets\\n */\\n function totalDistributions() external view returns (uint256) {\\n return distributionTargets.length;\\n }\\n\\n /**\\n * @dev Used to find out the percentage distribution for a particular destination based on schema\\n * @param destination the destination address of the distribution target\\n * @param schema the schema of the distribution target\\n * @return percentage percentage distribution\\n */\\n function getPercentageDistribution(address destination, Schema schema) external view returns (uint256) {\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 i = 0; i < distributionTargetsLength; ) {\\n DistributionConfig memory config = distributionTargets[i];\\n\\n if (config.destination == destination && config.schema == schema) {\\n return config.percentage;\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n }\\n\\n /**\\n * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\\n * @param comptroller Comptroller address (pool)\\n * @param asset Asset address.\\n * @param incomeType type of income\\n */\\n function updateAssetsState(\\n address comptroller,\\n address asset,\\n IncomeType incomeType\\n ) public override(IProtocolShareReserve) nonReentrant {\\n if (!IComptroller(comptroller).isComptroller()) revert InvalidAddress();\\n ensureNonzeroAddress(asset);\\n\\n if (\\n comptroller != CORE_POOL_COMPTROLLER &&\\n IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) == address(0)\\n ) revert InvalidAddress();\\n\\n Schema schema = _getSchema(incomeType);\\n uint256 currentBalance = IERC20Upgradeable(asset).balanceOf(address(this));\\n uint256 assetReserve = totalAssetReserve[asset];\\n\\n if (currentBalance > assetReserve) {\\n uint256 balanceDifference;\\n unchecked {\\n balanceDifference = currentBalance - assetReserve;\\n }\\n\\n assetsReserves[comptroller][asset][schema] += balanceDifference;\\n totalAssetReserve[asset] += balanceDifference;\\n emit AssetsReservesUpdated(comptroller, asset, balanceDifference, incomeType, schema);\\n }\\n }\\n\\n /**\\n * @dev asset from a particular pool to be release to distribution targets\\n * @param comptroller Comptroller address(pool)\\n * @param asset Asset address.\\n */\\n function _releaseFund(address comptroller, address asset) internal {\\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\\n uint256[] memory schemaBalances = new uint256[](totalSchemas);\\n uint256 totalBalance;\\n for (uint256 schemaValue; schemaValue < totalSchemas; ) {\\n schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];\\n totalBalance += schemaBalances[schemaValue];\\n\\n unchecked {\\n ++schemaValue;\\n }\\n }\\n\\n if (totalBalance == 0) {\\n return;\\n }\\n\\n uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);\\n for (uint256 i = 0; i < distributionTargets.length; ) {\\n DistributionConfig memory _config = distributionTargets[i];\\n\\n uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;\\n totalTransferAmounts[uint256(_config.schema)] += transferAmount;\\n\\n if (transferAmount != 0) {\\n IERC20Upgradeable(asset).safeTransfer(_config.destination, transferAmount);\\n IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);\\n\\n emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);\\n }\\n\\n unchecked {\\n ++i;\\n }\\n }\\n\\n uint256[] memory newSchemaBalances = new uint256[](totalSchemas);\\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\\n newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];\\n assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];\\n totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];\\n\\n emit ReservesUpdated(\\n comptroller,\\n asset,\\n Schema(schemaValue),\\n schemaBalances[schemaValue],\\n newSchemaBalances[schemaValue]\\n );\\n\\n unchecked {\\n ++schemaValue;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the schema based on income type\\n * @param incomeType type of income\\n * @return schema schema for distribution\\n */\\n function _getSchema(IncomeType incomeType) internal view returns (Schema schema) {\\n schema = Schema.ADDITIONAL_REVENUE;\\n\\n if (incomeType == IncomeType.SPREAD) {\\n schema = Schema.PROTOCOL_RESERVES;\\n }\\n }\\n\\n /**\\n * @dev This ensures that the total percentage of all the distribution targets is 100% or 0%\\n */\\n function _ensurePercentages() internal view {\\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\\n uint16[] memory totalPercentages = new uint16[](totalSchemas);\\n\\n uint256 distributionTargetsLength = distributionTargets.length;\\n for (uint256 i = 0; i < distributionTargetsLength; ) {\\n DistributionConfig memory config = distributionTargets[i];\\n totalPercentages[uint256(config.schema)] += config.percentage;\\n\\n unchecked {\\n ++i;\\n }\\n }\\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\\n if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)\\n revert InvalidTotalPercentage();\\n\\n unchecked {\\n ++schemaValue;\\n }\\n }\\n }\\n\\n /**\\n * @dev Returns the underlying asset address for the vToken\\n * @param vToken vToken address\\n * @return asset address of asset\\n */\\n function _getUnderlying(address vToken) internal view returns (address) {\\n if (vToken == vBNB) {\\n return WBNB;\\n } else {\\n return IVToken(vToken).underlying();\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa055981f35a958ff20ca595ffc1a93a331d06159d728e1c1d766d4545bc1ad52\",\"license\":\"BSD-3-Clause\"}},\"version\":1}", + "bytecode": "0x60e060405234801561001057600080fd5b50604051612f32380380612f3283398101604081905261002f91610178565b61003883610073565b61004182610073565b61004a81610073565b6001600160a01b0380841660805282811660a052811660c05261006b61009d565b5050506101bb565b6001600160a01b03811661009a576040516342bcdf7f60e11b815260040160405180910390fd5b50565b600054610100900460ff16156101095760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161461015a576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b80516001600160a01b038116811461017357600080fd5b919050565b60008060006060848603121561018d57600080fd5b6101968461015c565b92506101a46020850161015c565b91506101b26040850161015c565b90509250925092565b60805160a05160c051612d416101f16000396000610209015260006103090152600081816103c901526104bc0152612d416000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c8063893ffe98116100ee578063b4a0bdf311610097578063e30c397811610071578063e30c3978146103a0578063f2fde38b146103b1578063fa7b81a0146103c4578063fc31116a146103eb57600080fd5b8063b4a0bdf314610373578063be26317e14610384578063cd6dc6871461038d57600080fd5b8063966961f0116100c8578063966961f01461032b578063aea211211461033e578063afcff50f1461035f57600080fd5b8063893ffe98146102e05780638da5cb5b146102f35780638dd950021461030457600080fd5b80634f429f3611610150578063715018a61161012a578063715018a6146102bd57806379ba5097146102c55780637b77cd6a146102cd57600080fd5b80634f429f36146102655780635db6da12146102785780635f3d6133146102aa57600080fd5b806316faecec1161018157806316faecec146101f157806333e1567f14610204578063392ee7121461024357600080fd5b80630e32cb86146101a85780631036bbe2146101bd578063163db71b146101de575b600080fd5b6101bb6101b63660046125a8565b6103fe565b005b6101c661271081565b60405161ffff90911681526020015b60405180910390f35b610130545b6040519081526020016101d5565b6101bb6101ff3660046125d9565b610412565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d5565b610256610251366004612624565b610788565b6040516101d5939291906126a3565b6101bb6102733660046126d1565b6107c8565b6101e36102863660046125d9565b61012e60209081526000938452604080852082529284528284209052825290205481565b6101bb6102b836600461270a565b610b0a565b6101bb610e19565b6101bb610e2d565b6101bb6102db3660046125a8565b610ebd565b6101e36102ee36600461277f565b610f44565b6033546001600160a01b031661022b565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101e36103393660046127db565b611066565b6101e361034c3660046125a8565b61012f6020526000908152604090205481565b61012d5461022b906001600160a01b031681565b6097546001600160a01b031661022b565b6101e360fb5481565b6101bb61039b366004612809565b61115b565b6065546001600160a01b031661022b565b6101bb6103bf3660046125a8565b6112e6565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101bb6103f9366004612835565b61136f565b6104066113c5565b61040f8161141f565b50565b61041a611515565b826001600160a01b0316627e3dd26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906128bd565b6104b1576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104ba8261156e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614158015610593575061012d546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058891906128df565b6001600160a01b0316145b156105ca576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105d5826115ae565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038516906370a0823190602401602060405180830381865afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065c91906128fc565b6001600160a01b038516600090815261012f602052604090205490915080821115610776576001600160a01b03808716600090815261012e602090815260408083209389168352929052908120828403918291908660018111156106c2576106c261263d565b60018111156106d3576106d361263d565b815260200190815260200160002060008282546106f09190612944565b90915550506001600160a01b038616600090815261012f60205260408120805483929061071e908490612944565b92505081905550856001600160a01b0316876001600160a01b03167fa46b2431e663cf7b50c9d5129aff85d2394ecfd447b7ccba83986510a9d945ea83888860405161076c93929190612957565b60405180910390a3505b505050610783600160c955565b505050565b610130818154811061079957600080fd5b60009182526020909120015460ff81169150610100810461ffff1690630100000090046001600160a01b031683565b6107e9604051806060016040528060288152602001612cb0602891396115d9565b600080805b61013054811015610894576000610130828154811061080f5761080f612984565b6000918252602090912001805490915060ff1660018111156108335761083361263d565b8660018111156108455761084561263d565b148015610865575080546001600160a01b03868116630100000090920416145b801561087957508054610100900461ffff16155b1561088b576001925081935050610894565b506001016107ee565b508015610afc5761013082815481106108af576108af612984565b9060005260206000200160000160039054906101000a90046001600160a01b03166001600160a01b03167f70e7a210881df49522a5bf05d477e00d59e52a41c96c1eedeaeb356b9e6c81cc610130848154811061090e5761090e612984565b9060005260206000200160000160019054906101000a900461ffff16610130858154811061093e5761093e612984565b60009182526020909120015460405161095b929160ff16906129b3565b60405180910390a26101308054610974906001906129d4565b8154811061098457610984612984565b9060005260206000200161013083815481106109a2576109a2612984565b60009182526020909120825491018054909160ff169082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183818111156109ef576109ef61263d565b02179055508154815461ffff61010092839004169091027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff82168117835592546001600160a01b0363010000009182900416027fffffffffffffffffff0000000000000000000000000000000000000000ffffff9093167fffffffffffffffffff00000000000000000000000000000000000000000000ff90911617919091179055610130805480610aa357610aa36129e7565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffff00000000000000000000000000000000000000000000001690550190555b610b046116a5565b50505050565b610b12611515565b610b33604051806060016040528060348152602001612cd8603491396115d9565b60005b81811015610df5576000838383818110610b5257610b52612984565b905060600201803603810190610b689190612a45565b9050610b77816040015161156e565b61013054600090815b81811015610ca55760006101308281548110610b9e57610b9e612984565b6000918252602090912001805490915060ff166001811115610bc257610bc261263d565b85516001811115610bd557610bd561263d565b148015610bfa575060408501518154630100000090046001600160a01b039081169116145b15610c9c5760408581015182546020880151885193516001600160a01b03909316937fa682db621f4ae1c92cd6c492151d32fe657fc6db6e87bd65eb8bda05311f6ef293610c5393610100900461ffff16929190612ae5565b60405180910390a26020850151815461ffff909116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff90911617905560019250610ca5565b50600101610b80565b5081610de75761013080546001818101835560009290925284517f2f605e086faac1d93117bbfbc18835d434e9405fadc1ca66faf4b864746daf349091018054869391929183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908381811115610d2057610d2061263d565b021790555060208281015182546040948501517fffffffffffffffffff00000000000000000000000000000000000000000000ff90911661010061ffff909316929092027fffffffffffffffffff0000000000000000000000000000000000000000ffffff169190911763010000006001600160a01b03928316021790925585830151908601518651935191909216927f8c96910d818618d8b1de4e1b5672a192443e87aa553f0ebe4c47f9d8c928b28292610dde929091906129b3565b60405180910390a25b836001019350505050610b36565b50610dfe6116a5565b61013054610e0b9061187d565b610e15600160c955565b5050565b610e216113c5565b610e2b60006118c7565b565b60655433906001600160a01b03168114610eb45760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61040f816118c7565b610ec56113c5565b610ece8161156e565b61012d546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61013054600090815b8181101561105b5760006101308281548110610f6b57610f6b612984565b906000526020600020019050866001811115610f8957610f8961263d565b815460ff166001811115610f9f57610f9f61263d565b148015610fbf575080546001600160a01b03878116630100000090920416145b15611052576001600160a01b03808916600090815261012e60209081526040808320938916835292905290812081896001811115610fff57610fff61263d565b60018111156110105761101061263d565b815260208101919091526040016000205482549091506127109061103d90610100900461ffff1683612b01565b6110479190612b18565b94505050505061105e565b50600101610f4d565b50505b949350505050565b61013054600090815b81811015611152576000610130828154811061108d5761108d612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156110bc576110bc61263d565b60018111156110cd576110cd61263d565b81529054610100810461ffff166020830152630100000090046001600160a01b03908116604092830152908201519192508781169116148015611132575084600181111561111d5761111d61263d565b815160018111156111305761113061263d565b145b15611149576020015161ffff169250611155915050565b5060010161106f565b50505b92915050565b600054610100900460ff161580801561117b5750600054600160ff909116105b806111955750303b158015611195575060005460ff166001145b6112075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610eab565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561126557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61126e836118f8565b611276611986565b61127f82611a0b565b801561078357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6112ee6113c5565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556113376033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611377611515565b60005b818110156113ba576113b28484848481811061139857611398612984565b90506020020160208101906113ad91906125a8565b611ac0565b60010161137a565b50610783600160c955565b6033546001600160a01b03163314610e2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eab565b6001600160a01b03811661149b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610eab565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b600260c954036115675760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eab565b600260c955565b6001600160a01b03811661040f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008260018111156115c4576115c461263d565b036115cd575060005b919050565b600160c955565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906116259033908690600401612bc1565b602060405180830381865afa158015611642573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166691906128bd565b905080610e15573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610eab93929190612be3565b60006116b2600180612944565b905060008167ffffffffffffffff8111156116cf576116cf612a16565b6040519080825280602002602001820160405280156116f8578160200160208202803683370190505b506101305490915060005b818110156117e1576000610130828154811061172157611721612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156117505761175061263d565b60018111156117615761176161263d565b81529054610100810461ffff1660208084019190915263010000009091046001600160a01b0316604090920191909152810151815191925090859060018111156117ad576117ad61263d565b815181106117bd576117bd612984565b602002602001018181516117d19190612c18565b61ffff1690525050600101611703565b5060005b83811015610b045761271061ffff1683828151811061180657611806612984565b602002602001015161ffff161415801561183e575082818151811061182d5761182d612984565b602002602001015161ffff16600014155b15611875576040517f0b8ad7f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001016117e5565b60fb5481111561040f5760fb546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610eab565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561040f81612099565b600054610100900460ff166119755760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b61197d612103565b61040f81612188565b600054610100900460ff16611a035760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612205565b60fb548111611a825760405162461bcd60e51b815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610eab565b60fb80549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101611509565b6000611acd600180612944565b905060008167ffffffffffffffff811115611aea57611aea612a16565b604051908082528060200260200182016040528015611b13578160200160208202803683370190505b5090506000805b83811015611bdb576001600160a01b03808716600090815261012e60209081526040808320938916835292905290812090826001811115611b5d57611b5d61263d565b6001811115611b6e57611b6e61263d565b6001811115611b7f57611b7f61263d565b815260200190815260200160002054838281518110611ba057611ba0612984565b602002602001018181525050828181518110611bbe57611bbe612984565b602002602001015182611bd19190612944565b9150600101611b1a565b5080600003611beb575050505050565b60008367ffffffffffffffff811115611c0657611c06612a16565b604051908082528060200260200182016040528015611c2f578160200160208202803683370190505b50905060005b61013054811015611e645760006101308281548110611c5657611c56612984565b60009182526020909120604080516060810190915291018054829060ff166001811115611c8557611c8561263d565b6001811115611c9657611c9661263d565b81529054610100810461ffff90811660208085019190915263010000009092046001600160a01b0316604090930192909252820151825192935060009261271092919091169088906001811115611cef57611cef61263d565b81518110611cff57611cff612984565b6020026020010151611d119190612b01565b611d1b9190612b18565b9050808483600001516001811115611d3557611d3561263d565b81518110611d4557611d45612984565b60200260200101818151611d599190612944565b9052508015611e5a576040820151611d7c906001600160a01b038a169083612282565b60408083015190517faac59a750000000000000000000000000000000000000000000000000000000081526001600160a01b038b811660048301528a811660248301529091169063aac59a7590604401600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b50505050876001600160a01b031682604001516001600160a01b03167f09f71e7b22d78540ee9a42f09917a9d62f46735cb0dfa70d6bab27866d9cb5008460000151856020015185604051611e5193929190612c3a565b60405180910390a35b5050600101611c35565b5060008467ffffffffffffffff811115611e8057611e80612a16565b604051908082528060200260200182016040528015611ea9578160200160208202803683370190505b50905060005b8581101561208f57828181518110611ec957611ec9612984565b6020026020010151858281518110611ee357611ee3612984565b6020026020010151611ef591906129d4565b828281518110611f0757611f07612984565b602002602001018181525050818181518110611f2557611f25612984565b6020908102919091018101516001600160a01b03808b16600090815261012e84526040808220928c1682529190935282209091836001811115611f6a57611f6a61263d565b6001811115611f7b57611f7b61263d565b6001811115611f8c57611f8c61263d565b815260200190815260200160002081905550828181518110611fb057611fb0612984565b602002602001015161012f6000896001600160a01b03166001600160a01b0316815260200190815260200160002054611fe991906129d4565b6001600160a01b03808916600081815261012f602052604090209290925589167f7d881f3d6246a6a2b97b121b8ba093c17497912c68e8b2bca6108528e91df3ca83600181111561203c5761203c61263d565b88858151811061204e5761204e612984565b602002602001015186868151811061206857612068612984565b602002602001015160405161207f93929190612c5f565b60405180910390a3600101611eaf565b5050505050505050565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166121805760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612302565b600054610100900460ff166104065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b600054610100900460ff166115d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610783908490612388565b600054610100900460ff1661237f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b336118c7565b60006123dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124709092919063ffffffff16565b90508051600014806123fe5750808060200190518101906123fe91906128bd565b6107835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610eab565b606061105e848460008585600080866001600160a01b031685876040516124979190612c80565b60006040518083038185875af1925050503d80600081146124d4576040519150601f19603f3d011682016040523d82523d6000602084013e6124d9565b606091505b50915091506124ea878383876124f5565b979650505050505050565b6060831561256457825160000361255d576001600160a01b0385163b61255d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610eab565b508161105e565b61105e83838151156125795781518083602001fd5b8060405162461bcd60e51b8152600401610eab9190612c9c565b6001600160a01b038116811461040f57600080fd5b6000602082840312156125ba57600080fd5b81356125c581612593565b9392505050565b6002811061040f57600080fd5b6000806000606084860312156125ee57600080fd5b83356125f981612593565b9250602084013561260981612593565b91506040840135612619816125cc565b809150509250925092565b60006020828403121561263657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061040f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b606081016126b08561266c565b93815261ffff9290921660208301526001600160a01b031660409091015290565b600080604083850312156126e457600080fd5b82356126ef816125cc565b915060208301356126ff81612593565b809150509250929050565b6000806020838503121561271d57600080fd5b823567ffffffffffffffff8082111561273557600080fd5b818501915085601f83011261274957600080fd5b81358181111561275857600080fd5b86602060608302850101111561276d57600080fd5b60209290920196919550909350505050565b6000806000806080858703121561279557600080fd5b84356127a081612593565b935060208501356127b0816125cc565b925060408501356127c081612593565b915060608501356127d081612593565b939692955090935050565b600080604083850312156127ee57600080fd5b82356127f981612593565b915060208301356126ff816125cc565b6000806040838503121561281c57600080fd5b823561282781612593565b946020939093013593505050565b60008060006040848603121561284a57600080fd5b833561285581612593565b9250602084013567ffffffffffffffff8082111561287257600080fd5b818601915086601f83011261288657600080fd5b81358181111561289557600080fd5b8760208260051b85010111156128aa57600080fd5b6020830194508093505050509250925092565b6000602082840312156128cf57600080fd5b815180151581146125c557600080fd5b6000602082840312156128f157600080fd5b81516125c581612593565b60006020828403121561290e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561115557611155612915565b838152606081016129678461266c565b8360208301526129768361266c565b826040830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61ffff83168152604081016129c78361266c565b8260208301529392505050565b8181038181111561115557611155612915565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060608284031215612a5757600080fd5b6040516060810181811067ffffffffffffffff82111715612aa1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528235612aaf816125cc565b8152602083013561ffff81168114612ac657600080fd5b60208201526040830135612ad981612593565b60408201529392505050565b61ffff848116825283166020820152606081016129768361266c565b808202811582820484141761115557611155612915565b600082612b4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015612b6e578181015183820152602001612b56565b50506000910152565b60008151808452612b8f816020860160208601612b53565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b038316815260406020820152600061105e6040830184612b77565b60006001600160a01b03808616835280851660208401525060606040830152612c0f6060830184612b77565b95945050505050565b61ffff818116838216019080821115612c3357612c33612915565b5092915050565b60608101612c478561266c565b93815261ffff92909216602083015260409091015290565b60608101612c6c8561266c565b938152602081019290925260409091015290565b60008251612c92818460208701612b53565b9190910192915050565b6020815260006125c56020830184612b7756fe72656d6f7665446973747269627574696f6e436f6e66696728536368656d612c61646472657373296164644f72557064617465446973747269627574696f6e436f6e6669677328446973747269627574696f6e436f6e6669675b5d29a2646970667358221220b1db932da49f621b9742b1c134a47550b0625658dff025f09b897fba34f4d82c64736f6c63430008190033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101a35760003560e01c8063893ffe98116100ee578063b4a0bdf311610097578063e30c397811610071578063e30c3978146103a0578063f2fde38b146103b1578063fa7b81a0146103c4578063fc31116a146103eb57600080fd5b8063b4a0bdf314610373578063be26317e14610384578063cd6dc6871461038d57600080fd5b8063966961f0116100c8578063966961f01461032b578063aea211211461033e578063afcff50f1461035f57600080fd5b8063893ffe98146102e05780638da5cb5b146102f35780638dd950021461030457600080fd5b80634f429f3611610150578063715018a61161012a578063715018a6146102bd57806379ba5097146102c55780637b77cd6a146102cd57600080fd5b80634f429f36146102655780635db6da12146102785780635f3d6133146102aa57600080fd5b806316faecec1161018157806316faecec146101f157806333e1567f14610204578063392ee7121461024357600080fd5b80630e32cb86146101a85780631036bbe2146101bd578063163db71b146101de575b600080fd5b6101bb6101b63660046125a8565b6103fe565b005b6101c661271081565b60405161ffff90911681526020015b60405180910390f35b610130545b6040519081526020016101d5565b6101bb6101ff3660046125d9565b610412565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101d5565b610256610251366004612624565b610788565b6040516101d5939291906126a3565b6101bb6102733660046126d1565b6107c8565b6101e36102863660046125d9565b61012e60209081526000938452604080852082529284528284209052825290205481565b6101bb6102b836600461270a565b610b0a565b6101bb610e19565b6101bb610e2d565b6101bb6102db3660046125a8565b610ebd565b6101e36102ee36600461277f565b610f44565b6033546001600160a01b031661022b565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101e36103393660046127db565b611066565b6101e361034c3660046125a8565b61012f6020526000908152604090205481565b61012d5461022b906001600160a01b031681565b6097546001600160a01b031661022b565b6101e360fb5481565b6101bb61039b366004612809565b61115b565b6065546001600160a01b031661022b565b6101bb6103bf3660046125a8565b6112e6565b61022b7f000000000000000000000000000000000000000000000000000000000000000081565b6101bb6103f9366004612835565b61136f565b6104066113c5565b61040f8161141f565b50565b61041a611515565b826001600160a01b0316627e3dd26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610457573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061047b91906128bd565b6104b1576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104ba8261156e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614158015610593575061012d546040517f266e0a7f0000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152600092169063266e0a7f90604401602060405180830381865afa158015610564573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058891906128df565b6001600160a01b0316145b156105ca576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006105d5826115ae565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038516906370a0823190602401602060405180830381865afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065c91906128fc565b6001600160a01b038516600090815261012f602052604090205490915080821115610776576001600160a01b03808716600090815261012e602090815260408083209389168352929052908120828403918291908660018111156106c2576106c261263d565b60018111156106d3576106d361263d565b815260200190815260200160002060008282546106f09190612944565b90915550506001600160a01b038616600090815261012f60205260408120805483929061071e908490612944565b92505081905550856001600160a01b0316876001600160a01b03167fa46b2431e663cf7b50c9d5129aff85d2394ecfd447b7ccba83986510a9d945ea83888860405161076c93929190612957565b60405180910390a3505b505050610783600160c955565b505050565b610130818154811061079957600080fd5b60009182526020909120015460ff81169150610100810461ffff1690630100000090046001600160a01b031683565b6107e9604051806060016040528060288152602001612cb0602891396115d9565b600080805b61013054811015610894576000610130828154811061080f5761080f612984565b6000918252602090912001805490915060ff1660018111156108335761083361263d565b8660018111156108455761084561263d565b148015610865575080546001600160a01b03868116630100000090920416145b801561087957508054610100900461ffff16155b1561088b576001925081935050610894565b506001016107ee565b508015610afc5761013082815481106108af576108af612984565b9060005260206000200160000160039054906101000a90046001600160a01b03166001600160a01b03167f70e7a210881df49522a5bf05d477e00d59e52a41c96c1eedeaeb356b9e6c81cc610130848154811061090e5761090e612984565b9060005260206000200160000160019054906101000a900461ffff16610130858154811061093e5761093e612984565b60009182526020909120015460405161095b929160ff16906129b3565b60405180910390a26101308054610974906001906129d4565b8154811061098457610984612984565b9060005260206000200161013083815481106109a2576109a2612984565b60009182526020909120825491018054909160ff169082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183818111156109ef576109ef61263d565b02179055508154815461ffff61010092839004169091027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff82168117835592546001600160a01b0363010000009182900416027fffffffffffffffffff0000000000000000000000000000000000000000ffffff9093167fffffffffffffffffff00000000000000000000000000000000000000000000ff90911617919091179055610130805480610aa357610aa36129e7565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffff00000000000000000000000000000000000000000000001690550190555b610b046116a5565b50505050565b610b12611515565b610b33604051806060016040528060348152602001612cd8603491396115d9565b60005b81811015610df5576000838383818110610b5257610b52612984565b905060600201803603810190610b689190612a45565b9050610b77816040015161156e565b61013054600090815b81811015610ca55760006101308281548110610b9e57610b9e612984565b6000918252602090912001805490915060ff166001811115610bc257610bc261263d565b85516001811115610bd557610bd561263d565b148015610bfa575060408501518154630100000090046001600160a01b039081169116145b15610c9c5760408581015182546020880151885193516001600160a01b03909316937fa682db621f4ae1c92cd6c492151d32fe657fc6db6e87bd65eb8bda05311f6ef293610c5393610100900461ffff16929190612ae5565b60405180910390a26020850151815461ffff909116610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ff90911617905560019250610ca5565b50600101610b80565b5081610de75761013080546001818101835560009290925284517f2f605e086faac1d93117bbfbc18835d434e9405fadc1ca66faf4b864746daf349091018054869391929183917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016908381811115610d2057610d2061263d565b021790555060208281015182546040948501517fffffffffffffffffff00000000000000000000000000000000000000000000ff90911661010061ffff909316929092027fffffffffffffffffff0000000000000000000000000000000000000000ffffff169190911763010000006001600160a01b03928316021790925585830151908601518651935191909216927f8c96910d818618d8b1de4e1b5672a192443e87aa553f0ebe4c47f9d8c928b28292610dde929091906129b3565b60405180910390a25b836001019350505050610b36565b50610dfe6116a5565b61013054610e0b9061187d565b610e15600160c955565b5050565b610e216113c5565b610e2b60006118c7565b565b60655433906001600160a01b03168114610eb45760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060448201527f6e6577206f776e6572000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61040f816118c7565b610ec56113c5565b610ece8161156e565b61012d546040516001600160a01b038084169216907fa87b964d321035d2165e484ff4b722dd6eae30606c0b98887d2ed1a34e594bfe90600090a361012d80547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b61013054600090815b8181101561105b5760006101308281548110610f6b57610f6b612984565b906000526020600020019050866001811115610f8957610f8961263d565b815460ff166001811115610f9f57610f9f61263d565b148015610fbf575080546001600160a01b03878116630100000090920416145b15611052576001600160a01b03808916600090815261012e60209081526040808320938916835292905290812081896001811115610fff57610fff61263d565b60018111156110105761101061263d565b815260208101919091526040016000205482549091506127109061103d90610100900461ffff1683612b01565b6110479190612b18565b94505050505061105e565b50600101610f4d565b50505b949350505050565b61013054600090815b81811015611152576000610130828154811061108d5761108d612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156110bc576110bc61263d565b60018111156110cd576110cd61263d565b81529054610100810461ffff166020830152630100000090046001600160a01b03908116604092830152908201519192508781169116148015611132575084600181111561111d5761111d61263d565b815160018111156111305761113061263d565b145b15611149576020015161ffff169250611155915050565b5060010161106f565b50505b92915050565b600054610100900460ff161580801561117b5750600054600160ff909116105b806111955750303b158015611195575060005460ff166001145b6112075760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610eab565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561126557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61126e836118f8565b611276611986565b61127f82611a0b565b801561078357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6112ee6113c5565b606580546001600160a01b0383167fffffffffffffffffffffffff000000000000000000000000000000000000000090911681179091556113376033546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b611377611515565b60005b818110156113ba576113b28484848481811061139857611398612984565b90506020020160208101906113ad91906125a8565b611ac0565b60010161137a565b50610783600160c955565b6033546001600160a01b03163314610e2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610eab565b6001600160a01b03811661149b5760405162461bcd60e51b815260206004820152602560248201527f696e76616c696420616365737320636f6e74726f6c206d616e6167657220616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610eab565b609780546001600160a01b038381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa091015b60405180910390a15050565b600260c954036115675760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610eab565b600260c955565b6001600160a01b03811661040f576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008260018111156115c4576115c461263d565b036115cd575060005b919050565b600160c955565b6097546040517f18c5e8ab0000000000000000000000000000000000000000000000000000000081526000916001600160a01b0316906318c5e8ab906116259033908690600401612bc1565b602060405180830381865afa158015611642573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166691906128bd565b905080610e15573330836040517f4a3fa293000000000000000000000000000000000000000000000000000000008152600401610eab93929190612be3565b60006116b2600180612944565b905060008167ffffffffffffffff8111156116cf576116cf612a16565b6040519080825280602002602001820160405280156116f8578160200160208202803683370190505b506101305490915060005b818110156117e1576000610130828154811061172157611721612984565b60009182526020909120604080516060810190915291018054829060ff1660018111156117505761175061263d565b60018111156117615761176161263d565b81529054610100810461ffff1660208084019190915263010000009091046001600160a01b0316604090920191909152810151815191925090859060018111156117ad576117ad61263d565b815181106117bd576117bd612984565b602002602001018181516117d19190612c18565b61ffff1690525050600101611703565b5060005b83811015610b045761271061ffff1683828151811061180657611806612984565b602002602001015161ffff161415801561183e575082818151811061182d5761182d612984565b602002602001015161ffff16600014155b15611875576040517f0b8ad7f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001016117e5565b60fb5481111561040f5760fb546040517ff257f636000000000000000000000000000000000000000000000000000000008152600481019190915260248101829052604401610eab565b606580547fffffffffffffffffffffffff000000000000000000000000000000000000000016905561040f81612099565b600054610100900460ff166119755760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b61197d612103565b61040f81612188565b600054610100900460ff16611a035760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612205565b60fb548111611a825760405162461bcd60e51b815260206004820152602260248201527f436f6d7074726f6c6c65723a20496e76616c6964206d61784c6f6f70734c696d60448201527f69740000000000000000000000000000000000000000000000000000000000006064820152608401610eab565b60fb80549082905560408051828152602081018490527fc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa9101611509565b6000611acd600180612944565b905060008167ffffffffffffffff811115611aea57611aea612a16565b604051908082528060200260200182016040528015611b13578160200160208202803683370190505b5090506000805b83811015611bdb576001600160a01b03808716600090815261012e60209081526040808320938916835292905290812090826001811115611b5d57611b5d61263d565b6001811115611b6e57611b6e61263d565b6001811115611b7f57611b7f61263d565b815260200190815260200160002054838281518110611ba057611ba0612984565b602002602001018181525050828181518110611bbe57611bbe612984565b602002602001015182611bd19190612944565b9150600101611b1a565b5080600003611beb575050505050565b60008367ffffffffffffffff811115611c0657611c06612a16565b604051908082528060200260200182016040528015611c2f578160200160208202803683370190505b50905060005b61013054811015611e645760006101308281548110611c5657611c56612984565b60009182526020909120604080516060810190915291018054829060ff166001811115611c8557611c8561263d565b6001811115611c9657611c9661263d565b81529054610100810461ffff90811660208085019190915263010000009092046001600160a01b0316604090930192909252820151825192935060009261271092919091169088906001811115611cef57611cef61263d565b81518110611cff57611cff612984565b6020026020010151611d119190612b01565b611d1b9190612b18565b9050808483600001516001811115611d3557611d3561263d565b81518110611d4557611d45612984565b60200260200101818151611d599190612944565b9052508015611e5a576040820151611d7c906001600160a01b038a169083612282565b60408083015190517faac59a750000000000000000000000000000000000000000000000000000000081526001600160a01b038b811660048301528a811660248301529091169063aac59a7590604401600060405180830381600087803b158015611de657600080fd5b505af1158015611dfa573d6000803e3d6000fd5b50505050876001600160a01b031682604001516001600160a01b03167f09f71e7b22d78540ee9a42f09917a9d62f46735cb0dfa70d6bab27866d9cb5008460000151856020015185604051611e5193929190612c3a565b60405180910390a35b5050600101611c35565b5060008467ffffffffffffffff811115611e8057611e80612a16565b604051908082528060200260200182016040528015611ea9578160200160208202803683370190505b50905060005b8581101561208f57828181518110611ec957611ec9612984565b6020026020010151858281518110611ee357611ee3612984565b6020026020010151611ef591906129d4565b828281518110611f0757611f07612984565b602002602001018181525050818181518110611f2557611f25612984565b6020908102919091018101516001600160a01b03808b16600090815261012e84526040808220928c1682529190935282209091836001811115611f6a57611f6a61263d565b6001811115611f7b57611f7b61263d565b6001811115611f8c57611f8c61263d565b815260200190815260200160002081905550828181518110611fb057611fb0612984565b602002602001015161012f6000896001600160a01b03166001600160a01b0316815260200190815260200160002054611fe991906129d4565b6001600160a01b03808916600081815261012f602052604090209290925589167f7d881f3d6246a6a2b97b121b8ba093c17497912c68e8b2bca6108528e91df3ca83600181111561203c5761203c61263d565b88858151811061204e5761204e612984565b602002602001015186868151811061206857612068612984565b602002602001015160405161207f93929190612c5f565b60405180910390a3600101611eaf565b5050505050505050565b603380546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff166121805760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b612302565b600054610100900460ff166104065760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b600054610100900460ff166115d25760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610783908490612388565b600054610100900460ff1661237f5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610eab565b610e2b336118c7565b60006123dd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166124709092919063ffffffff16565b90508051600014806123fe5750808060200190518101906123fe91906128bd565b6107835760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610eab565b606061105e848460008585600080866001600160a01b031685876040516124979190612c80565b60006040518083038185875af1925050503d80600081146124d4576040519150601f19603f3d011682016040523d82523d6000602084013e6124d9565b606091505b50915091506124ea878383876124f5565b979650505050505050565b6060831561256457825160000361255d576001600160a01b0385163b61255d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610eab565b508161105e565b61105e83838151156125795781518083602001fd5b8060405162461bcd60e51b8152600401610eab9190612c9c565b6001600160a01b038116811461040f57600080fd5b6000602082840312156125ba57600080fd5b81356125c581612593565b9392505050565b6002811061040f57600080fd5b6000806000606084860312156125ee57600080fd5b83356125f981612593565b9250602084013561260981612593565b91506040840135612619816125cc565b809150509250925092565b60006020828403121561263657600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6002811061040f577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b606081016126b08561266c565b93815261ffff9290921660208301526001600160a01b031660409091015290565b600080604083850312156126e457600080fd5b82356126ef816125cc565b915060208301356126ff81612593565b809150509250929050565b6000806020838503121561271d57600080fd5b823567ffffffffffffffff8082111561273557600080fd5b818501915085601f83011261274957600080fd5b81358181111561275857600080fd5b86602060608302850101111561276d57600080fd5b60209290920196919550909350505050565b6000806000806080858703121561279557600080fd5b84356127a081612593565b935060208501356127b0816125cc565b925060408501356127c081612593565b915060608501356127d081612593565b939692955090935050565b600080604083850312156127ee57600080fd5b82356127f981612593565b915060208301356126ff816125cc565b6000806040838503121561281c57600080fd5b823561282781612593565b946020939093013593505050565b60008060006040848603121561284a57600080fd5b833561285581612593565b9250602084013567ffffffffffffffff8082111561287257600080fd5b818601915086601f83011261288657600080fd5b81358181111561289557600080fd5b8760208260051b85010111156128aa57600080fd5b6020830194508093505050509250925092565b6000602082840312156128cf57600080fd5b815180151581146125c557600080fd5b6000602082840312156128f157600080fd5b81516125c581612593565b60006020828403121561290e57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561115557611155612915565b838152606081016129678461266c565b8360208301526129768361266c565b826040830152949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b61ffff83168152604081016129c78361266c565b8260208301529392505050565b8181038181111561115557611155612915565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060608284031215612a5757600080fd5b6040516060810181811067ffffffffffffffff82111715612aa1577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040528235612aaf816125cc565b8152602083013561ffff81168114612ac657600080fd5b60208201526040830135612ad981612593565b60408201529392505050565b61ffff848116825283166020820152606081016129768361266c565b808202811582820484141761115557611155612915565b600082612b4e577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60005b83811015612b6e578181015183820152602001612b56565b50506000910152565b60008151808452612b8f816020860160208601612b53565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6001600160a01b038316815260406020820152600061105e6040830184612b77565b60006001600160a01b03808616835280851660208401525060606040830152612c0f6060830184612b77565b95945050505050565b61ffff818116838216019080821115612c3357612c33612915565b5092915050565b60608101612c478561266c565b93815261ffff92909216602083015260409091015290565b60608101612c6c8561266c565b938152602081019290925260409091015290565b60008251612c92818460208701612b53565b9190910192915050565b6020815260006125c56020830184612b7756fe72656d6f7665446973747269627574696f6e436f6e66696728536368656d612c61646472657373296164644f72557064617465446973747269627574696f6e436f6e6669677328446973747269627574696f6e436f6e6669675b5d29a2646970667358221220b1db932da49f621b9742b1c134a47550b0625658dff025f09b897fba34f4d82c64736f6c63430008190033", + "devdoc": { + "events": { + "Initialized(uint8)": { + "details": "Triggered when the contract has been initialized or reinitialized." + } + }, + "kind": "dev", + "methods": { + "acceptOwnership()": { + "details": "The new owner accepts the ownership transfer." + }, + "addOrUpdateDistributionConfigs((uint8,uint16,address)[])": { + "details": "Add or update destination targets based on destination address", + "params": { + "configs": "configurations of the destinations." + } + }, + "constructor": { + "custom:oz-upgrades-unsafe-allow": "constructor" + }, + "getPercentageDistribution(address,uint8)": { + "details": "Used to find out the percentage distribution for a particular destination based on schema", + "params": { + "destination": "the destination address of the distribution target", + "schema": "the schema of the distribution target" + }, + "returns": { + "_0": "percentage percentage distribution" + } + }, + "getUnreleasedFunds(address,uint8,address,address)": { + "details": "Used to find out the amount of funds that's going to be released when release funds is called.", + "params": { + "asset": "the asset address which will be released", + "comptroller": "the comptroller address of the pool", + "destination": "the destination address of the distribution target", + "schema": "the schema of the distribution target" + } + }, + "initialize(address,uint256)": { + "details": "Initializes the deployer to owner.", + "params": { + "_accessControlManager": "The address of ACM contract", + "_loopsLimit": "Limit for the loops in the contract to avoid DOS" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "pendingOwner()": { + "details": "Returns the address of the pending owner." + }, + "releaseFunds(address,address[])": { + "details": "Release funds", + "params": { + "assets": "assets to be released to distribution targets", + "comptroller": "the comptroller address of the pool" + } + }, + "removeDistributionConfig(uint8,address)": { + "details": "Remove destionation target if percentage is 0", + "params": { + "destination": "destination address of the configuration", + "schema": "schema of the configuration" + } + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "setAccessControlManager(address)": { + "custom:access": "Only Governance", + "custom:event": "Emits NewAccessControlManager event", + "details": "Admin function to set address of AccessControlManager", + "params": { + "accessControlManager_": "The new address of the AccessControlManager" + } + }, + "setPoolRegistry(address)": { + "custom:error": "ZeroAddressNotAllowed is thrown when pool registry address is zero", + "details": "Pool registry setter.", + "params": { + "_poolRegistry": "Address of the pool registry" + } + }, + "totalDistributions()": { + "details": "Returns the total number of distribution targets" + }, + "transferOwnership(address)": { + "details": "Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner." + }, + "updateAssetsState(address,address,uint8)": { + "details": "Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.", + "params": { + "asset": "Asset address.", + "comptroller": "Comptroller address (pool)", + "incomeType": "type of income" + } + } + }, + "stateVariables": { + "CORE_POOL_COMPTROLLER": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + }, + "WBNB": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + }, + "vBNB": { + "custom:oz-upgrades-unsafe-allow": "state-variable-immutable" + } + }, + "version": 1 + }, + "userdoc": { + "errors": { + "MaxLoopsLimitExceeded(uint256,uint256)": [ + { + "notice": "Thrown an error on maxLoopsLimit exceeds for any loop" + } + ], + "Unauthorized(address,address,string)": [ + { + "notice": "Thrown when the action is prohibited by AccessControlManager" + } + ], + "ZeroAddressNotAllowed()": [ + { + "notice": "Thrown if the supplied address is a zero address where it is not allowed" + } + ] + }, + "events": { + "AssetReleased(address,address,uint8,uint256,uint256)": { + "notice": "Event emitted when an asset is released to a target" + }, + "AssetsReservesUpdated(address,address,uint256,uint8,uint8)": { + "notice": "Event emitted after updating of the assets reserves." + }, + "DistributionConfigAdded(address,uint16,uint8)": { + "notice": "Event emitted when distribution configuration is added" + }, + "DistributionConfigRemoved(address,uint16,uint8)": { + "notice": "Event emitted when distribution configuration is removed" + }, + "DistributionConfigUpdated(address,uint16,uint16,uint8)": { + "notice": "Event emitted when distribution configuration is updated" + }, + "MaxLoopsLimitUpdated(uint256,uint256)": { + "notice": "Emitted when max loops limit is set" + }, + "NewAccessControlManager(address,address)": { + "notice": "Emitted when access control manager contract address is changed" + }, + "PoolRegistryUpdated(address,address)": { + "notice": "Emitted when pool registry address is updated" + }, + "ReservesUpdated(address,address,uint8,uint256,uint256)": { + "notice": "Event emitted when asset reserves state is updated" + } + }, + "kind": "user", + "methods": { + "CORE_POOL_COMPTROLLER()": { + "notice": "address of core pool comptroller contract" + }, + "WBNB()": { + "notice": "address of WBNB contract" + }, + "accessControlManager()": { + "notice": "Returns the address of the access control manager contract" + }, + "assetsReserves(address,address,uint8)": { + "notice": "comptroller => asset => schema => balance" + }, + "distributionTargets(uint256)": { + "notice": "configuration for different income distribution targets" + }, + "poolRegistry()": { + "notice": "address of pool registry contract" + }, + "setAccessControlManager(address)": { + "notice": "Sets the address of AccessControlManager" + }, + "totalAssetReserve(address)": { + "notice": "asset => balance" + }, + "vBNB()": { + "notice": "address of vBNB contract" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 244, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8" + }, + { + "astId": 247, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 1478, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 116, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 236, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 25, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_pendingOwner", + "offset": 0, + "slot": "101", + "type": "t_address" + }, + { + "astId": 104, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 5417, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_accessControlManager", + "offset": 0, + "slot": "151", + "type": "t_contract(IAccessControlManagerV8)5602" + }, + { + "astId": 5422, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "152", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 547, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "_status", + "offset": 0, + "slot": "201", + "type": "t_uint256" + }, + { + "astId": 616, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "202", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 6563, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "maxLoopsLimit", + "offset": 0, + "slot": "251", + "type": "t_uint256" + }, + { + "astId": 6568, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "__gap", + "offset": 0, + "slot": "252", + "type": "t_array(t_uint256)49_storage" + }, + { + "astId": 6964, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "poolRegistry", + "offset": 0, + "slot": "301", + "type": "t_address" + }, + { + "astId": 6977, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "assetsReserves", + "offset": 0, + "slot": "302", + "type": "t_mapping(t_address,t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256)))" + }, + { + "astId": 6982, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "totalAssetReserve", + "offset": 0, + "slot": "303", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 6987, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "distributionTargets", + "offset": 0, + "slot": "304", + "type": "t_array(t_struct(DistributionConfig)6952_storage)dyn_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(DistributionConfig)6952_storage)dyn_storage": { + "base": "t_struct(DistributionConfig)6952_storage", + "encoding": "dynamic_array", + "label": "struct ProtocolShareReserve.DistributionConfig[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IAccessControlManagerV8)5602": { + "encoding": "inplace", + "label": "contract IAccessControlManagerV8", + "numberOfBytes": "20" + }, + "t_enum(Schema)6943": { + "encoding": "inplace", + "label": "enum ProtocolShareReserve.Schema", + "numberOfBytes": "1" + }, + "t_mapping(t_address,t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256)))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => mapping(enum ProtocolShareReserve.Schema => uint256)))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256))" + }, + "t_mapping(t_address,t_mapping(t_enum(Schema)6943,t_uint256))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(enum ProtocolShareReserve.Schema => uint256))", + "numberOfBytes": "32", + "value": "t_mapping(t_enum(Schema)6943,t_uint256)" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_enum(Schema)6943,t_uint256)": { + "encoding": "mapping", + "key": "t_enum(Schema)6943", + "label": "mapping(enum ProtocolShareReserve.Schema => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_struct(DistributionConfig)6952_storage": { + "encoding": "inplace", + "label": "struct ProtocolShareReserve.DistributionConfig", + "members": [ + { + "astId": 6946, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "schema", + "offset": 0, + "slot": "0", + "type": "t_enum(Schema)6943" + }, + { + "astId": 6949, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "percentage", + "offset": 1, + "slot": "0", + "type": "t_uint16" + }, + { + "astId": 6951, + "contract": "contracts/ProtocolReserve/ProtocolShareReserve.sol:ProtocolShareReserve", + "label": "destination", + "offset": 3, + "slot": "0", + "type": "t_address" + } + ], + "numberOfBytes": "32" + }, + "t_uint16": { + "encoding": "inplace", + "label": "uint16", + "numberOfBytes": "2" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} diff --git a/deployments/basemainnet/ProtocolShareReserve_Proxy.json b/deployments/basemainnet/ProtocolShareReserve_Proxy.json new file mode 100644 index 00000000..e03b60d6 --- /dev/null +++ b/deployments/basemainnet/ProtocolShareReserve_Proxy.json @@ -0,0 +1,277 @@ +{ + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "receipt": { + "to": null, + "from": "0xdB7a865041d965f575CAB277783fF490508A21F3", + "contractAddress": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "transactionIndex": 60, + "gasUsed": "843177", + "logsBloom": "0x00000000000000000800000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000100000008000800000000000000000000000000002000001000000000000000000000010000000000000021000000000000000000800000000800000000000000000000000400000000000010000000000000000000000000000000080000000000000800000000000000000000000002000000400000000000000800000000000000000000000000020000000000000000001040000000000000400000000000000000020000000000200000000000001000000000000000800000400000000000000000000", + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9", + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "logs": [ + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x0000000000000000000000008991cc6b4494b71621f5a4f6633695f896fd37ee" + ], + "data": "0x", + "logIndex": 213, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000db7a865041d965f575cab277783ff490508a21f3" + ], + "data": "0x", + "logIndex": 214, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0x66fd58e82f7b31a2a5c30e0888f3093efe4e111b00cd2b0c31fe014601293aa0"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000009e6ceefdc6183e4d0df8092a9b90cdf659687dab", + "logIndex": 215, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0xc2d09fef144f7c8a86f71ea459f8fc17f675768eb1ae369cbd77fb31d467aafa"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014", + "logIndex": 216, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498"], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 217, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + }, + { + "transactionIndex": 60, + "blockNumber": 23344921, + "transactionHash": "0xc409d34b7187eb297af37a7a6a3973f3b48d6fd1569d5bcdfa610053004ee680", + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "topics": ["0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f"], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000007b06ef6b68648c61afe0f715740fe3950b90746b", + "logIndex": 218, + "blockHash": "0xeecc84058ab3ce1670b7def23af367ba31ca698fd22e1ce21ad969e32d3228e9" + } + ], + "blockNumber": 23344921, + "cumulativeGasUsed": "13256778", + "status": 1, + "byzantium": true + }, + "args": [ + "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "0xcd6dc6870000000000000000000000009e6ceefdc6183e4d0df8092a9b90cdf659687dab0000000000000000000000000000000000000000000000000000000000000014" + ], + "numDeployments": 1, + "solcInputHash": "0e89febeebc7444140de8e67c9067d2c", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x93b4e21c931252739a1ec13ea31d3d35a5c068be3163ccab83e4d70c40355f03\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view virtual returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(Address.isContract(IBeacon(newBeacon).implementation()), \\\"ERC1967: beacon implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x17668652127feebed0ce8d9431ef95ccc8c4292f03e3b8cf06c6ca16af396633\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xd5d1fd16e9faff7fcb3a52e02a8d49156f42a38a03f07b5f1810c21c2149a8ab\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1967/ERC1967Proxy.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.admin\\\")) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(\\\"\\\"), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(msg.sender != _getAdmin(), \\\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\\\");\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x140055a64cf579d622e04f5a198595832bf2cb193cd0005f4f2d4d61ca906253\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \\\"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 require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(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 require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason 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 // 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\\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}\\n\",\"keccak256\":\"0x3777e696b62134e6177440dbe6e6601c0c156a443f57167194b67e75527439de\",\"license\":\"MIT\"},\"solc_0.8/openzeppelin/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x6080604052604051620011b2380380620011b2833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b6000805160206200116b833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b6000805160206200114b83398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b620002ff1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e983836040518060600160405280602781526020016200118b6027913962000381565b9392505050565b60006200021a6000805160206200114b83398151915260001b6200046760201b620002731760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd6000805160206200114b83398151915260001b6200046760201b620002731760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200032b1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd6000805160206200116b83398151915260001b6200046760201b620002731760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b610ab380620006986000396000f3fe60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100a85780638f283970146100e6578063f851a440146101065761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61011b565b005b61006b61011b565b34801561008157600080fd5b5061006b61009036600461091f565b610135565b61006b6100a336600461093a565b610196565b3480156100b457600080fd5b506100bd610221565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f257600080fd5b5061006b61010136600461091f565b610276565b34801561011257600080fd5b506100bd6102ba565b610123610347565b61013361012e610435565b61043f565b565b61013d610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816040518060200160405280600081525060006104a3565b50565b61018b61011b565b61019e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610219576102148383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250600192506104a3915050565b505050565b61021461011b565b600061022b610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610435565b905090565b61027361011b565b90565b61027e610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561018e5761018b816104ce565b60006102c4610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561026b57610266610463565b60606103248383604051806060016040528060278152602001610a576027913961052f565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b61034f610463565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f7879207461726760648201527f6574000000000000000000000000000000000000000000000000000000000000608482015260a4015b60405180910390fd5b6000610266610657565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b5473ffffffffffffffffffffffffffffffffffffffff16919050565b6104ac8361067f565b6000825111806104b95750805b15610214576104c883836102ff565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104f7610463565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a161018b816106cc565b606073ffffffffffffffffffffffffffffffffffffffff84163b6105d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e74726163740000000000000000000000000000000000000000000000000000606482015260840161042c565b6000808573ffffffffffffffffffffffffffffffffffffffff16856040516105fd91906109e9565b600060405180830381855af49150503d8060008114610638576040519150601f19603f3d011682016040523d82523d6000602084013e61063d565b606091505b509150915061064d8282866107d8565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610487565b6106888161082b565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b73ffffffffffffffffffffffffffffffffffffffff811661076f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161042c565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff9290921691909117905550565b606083156107e7575081610324565b8251156107f75782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042c9190610a05565b73ffffffffffffffffffffffffffffffffffffffff81163b6108cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e747261637400000000000000000000000000000000000000606482015260840161042c565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610792565b803573ffffffffffffffffffffffffffffffffffffffff8116811461091a57600080fd5b919050565b60006020828403121561093157600080fd5b610324826108f6565b60008060006040848603121561094f57600080fd5b610958846108f6565b9250602084013567ffffffffffffffff8082111561097557600080fd5b818601915086601f83011261098957600080fd5b81358181111561099857600080fd5b8760208285010111156109aa57600080fd5b6020830194508093505050509250925092565b60005b838110156109d85781810151838201526020016109c0565b838111156104c85750506000910152565b600082516109fb8184602087016109bd565b9190910192915050565b6020815260008251806020840152610a248160408501602087016109bd565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220b29caa54336b3ee836679675e9732ec5e526fb3f803cca2fe336cc3555aba62264736f6c634300080a0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} diff --git a/deployments/basemainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json b/deployments/basemainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json new file mode 100644 index 00000000..557e5cb0 --- /dev/null +++ b/deployments/basemainnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json @@ -0,0 +1,78 @@ +{ + "language": "Solidity", + "sources": { + "solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \"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 require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(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 require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(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 require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason 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 // 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\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}\n" + }, + "solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/UUPSUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n *\n * _Available since v4.1._\n */\nabstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment\n address private immutable __self = address(this);\n\n /**\n * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n * a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case\n * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n * function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n * fail.\n */\n modifier onlyProxy() {\n require(address(this) != __self, \"Function must be called through delegatecall\");\n require(_getImplementation() == __self, \"Function must be called through active proxy\");\n _;\n }\n\n /**\n * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n * callable on the implementing contract but not through proxies.\n */\n modifier notDelegated() {\n require(address(this) == __self, \"UUPSUpgradeable: must not be called through delegatecall\");\n _;\n }\n\n /**\n * @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the\n * implementation. It is used to validate that the this implementation remains valid after an upgrade.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.\n */\n function proxiableUUID() external view virtual override notDelegated returns (bytes32) {\n return _IMPLEMENTATION_SLOT;\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeTo(address newImplementation) external virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, new bytes(0), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n * encoded in `data`.\n *\n * Calls {_authorizeUpgrade}.\n *\n * Emits an {Upgraded} event.\n */\n function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {\n _authorizeUpgrade(newImplementation);\n _upgradeToAndCallUUPS(newImplementation, data, true);\n }\n\n /**\n * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n * {upgradeTo} and {upgradeToAndCall}.\n *\n * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n *\n * ```solidity\n * function _authorizeUpgrade(address) internal override onlyOwner {}\n * ```\n */\n function _authorizeUpgrade(address newImplementation) internal virtual;\n}\n" + }, + "solc_0.8/openzeppelin/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n\n constructor(address implementation_, address initialOwner) Ownable(initialOwner) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "solc_0.8/openzeppelin/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n assert(_BEACON_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.beacon\")) - 1));\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 999999 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/deployments/basemainnet/solcInputs/af615647fec601102c25fd7b3b76f11e.json b/deployments/basemainnet/solcInputs/af615647fec601102c25fd7b3b76f11e.json new file mode 100644 index 00000000..a6ecb37d --- /dev/null +++ b/deployments/basemainnet/solcInputs/af615647fec601102c25fd7b3b76f11e.json @@ -0,0 +1,280 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./OwnableUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership} and {acceptOwnership}.\n *\n * This module is used through inheritance. It will make available all functions\n * from parent (Ownable).\n */\nabstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {\n function __Ownable2Step_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable2Step_init_unchained() internal onlyInitializing {\n }\n address private _pendingOwner;\n\n event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Returns the address of the pending owner.\n */\n function pendingOwner() public view virtual returns (address) {\n return _pendingOwner;\n }\n\n /**\n * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual override onlyOwner {\n _pendingOwner = newOwner;\n emit OwnershipTransferStarted(owner(), newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual override {\n delete _pendingOwner;\n super._transferOwnership(newOwner);\n }\n\n /**\n * @dev The new owner accepts the ownership transfer.\n */\n function acceptOwnership() public virtual {\n address sender = _msgSender();\n require(pendingOwner() == sender, \"Ownable2Step: caller is not the new owner\");\n _transferOwnership(sender);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n function __Ownable_init() internal onlyInitializing {\n __Ownable_init_unchained();\n }\n\n function __Ownable_init_unchained() internal onlyInitializing {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/AddressUpgradeable.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized != type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/ContextUpgradeable.sol\";\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n function __Pausable_init() internal onlyInitializing {\n __Pausable_init_unchained();\n }\n\n function __Pausable_init_unchained() internal onlyInitializing {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuardUpgradeable is Initializable {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n function __ReentrancyGuard_init() internal onlyInitializing {\n __ReentrancyGuard_init_unchained();\n }\n\n function __ReentrancyGuard_init_unchained() internal onlyInitializing {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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 IERC20PermitUpgradeable {\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" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20Upgradeable {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20Upgradeable.sol\";\nimport \"../extensions/IERC20PermitUpgradeable.sol\";\nimport \"../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {\n using AddressUpgradeable for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) 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(IERC20Upgradeable token, address spender, uint256 value) 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 /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20PermitUpgradeable 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(IERC20Upgradeable 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 require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation 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 * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\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 cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\n }\n}\n" + }, + "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary AddressUpgradeable {\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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\nimport \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract ContextUpgradeable is Initializable {\n function __Context_init() internal onlyInitializing {\n }\n\n function __Context_init_unchained() internal onlyInitializing {\n }\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[50] private __gap;\n}\n" + }, + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1967.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../Proxy.sol\";\nimport \"../ERC1967/ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the proxy with `beacon`.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\n * constructor.\n *\n * Requirements:\n *\n * - `beacon` must be a contract with the interface {IBeacon}.\n */\n constructor(address beacon, bytes memory data) payable {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IBeacon.sol\";\nimport \"../../access/Ownable.sol\";\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"UpgradeableBeacon: implementation is not a contract\");\n _implementation = newImplementation;\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/IERC1967.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(ITransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(ITransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(ITransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n ITransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(address) external;\n\n function upgradeTo(address) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(address _logic, address admin_, bytes memory _data) payable ERC1967Proxy(_logic, _data) {\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n revert(\"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n\n return \"\";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return \"\";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() private {\n require(msg.value == 0);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/ERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC20.sol\";\nimport \"./extensions/IERC20Metadata.sol\";\nimport \"../../utils/Context.sol\";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn't required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it's overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, \"ERC20: decreased allowance below zero\");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), \"ERC20: transfer from the zero address\");\n require(to != address(0), \"ERC20: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, \"ERC20: transfer amount exceeds balance\");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: mint to the zero address\");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), \"ERC20: burn from the zero address\");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, \"ERC20: burn amount exceeds balance\");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), \"ERC20: approve from the zero address\");\n require(spender != address(0), \"ERC20: approve to the zero address\");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, \"ERC20: insufficient allowance\");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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 * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\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://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/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(address target, bytes memory data, uint256 value) 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" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@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" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.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(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^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 // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\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(uint256 x, uint256 y, uint256 denominator, Rounding rounding) 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 // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `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 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.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 `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n 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 /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\n\nimport \"./IAccessControlManagerV8.sol\";\n\n/**\n * @title AccessControlledV8\n * @author Venus\n * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)\n * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.\n */\nabstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {\n /// @notice Access control manager contract\n IAccessControlManagerV8 private _accessControlManager;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when access control manager contract address is changed\n event NewAccessControlManager(address oldAccessControlManager, address newAccessControlManager);\n\n /// @notice Thrown when the action is prohibited by AccessControlManager\n error Unauthorized(address sender, address calledContract, string methodSignature);\n\n function __AccessControlled_init(address accessControlManager_) internal onlyInitializing {\n __Ownable2Step_init();\n __AccessControlled_init_unchained(accessControlManager_);\n }\n\n function __AccessControlled_init_unchained(address accessControlManager_) internal onlyInitializing {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Sets the address of AccessControlManager\n * @dev Admin function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n * @custom:event Emits NewAccessControlManager event\n * @custom:access Only Governance\n */\n function setAccessControlManager(address accessControlManager_) external onlyOwner {\n _setAccessControlManager(accessControlManager_);\n }\n\n /**\n * @notice Returns the address of the access control manager contract\n */\n function accessControlManager() external view returns (IAccessControlManagerV8) {\n return _accessControlManager;\n }\n\n /**\n * @dev Internal function to set address of AccessControlManager\n * @param accessControlManager_ The new address of the AccessControlManager\n */\n function _setAccessControlManager(address accessControlManager_) internal {\n require(address(accessControlManager_) != address(0), \"invalid acess control manager address\");\n address oldAccessControlManager = address(_accessControlManager);\n _accessControlManager = IAccessControlManagerV8(accessControlManager_);\n emit NewAccessControlManager(oldAccessControlManager, accessControlManager_);\n }\n\n /**\n * @notice Reverts if the call is not allowed by AccessControlManager\n * @param signature Method signature\n */\n function _checkAccessAllowed(string memory signature) internal view {\n bool isAllowedToCall = _accessControlManager.isAllowedToCall(msg.sender, signature);\n\n if (!isAllowedToCall) {\n revert Unauthorized(msg.sender, address(this), signature);\n }\n }\n}\n" + }, + "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @title IAccessControlManagerV8\n * @author Venus\n * @notice Interface implemented by the `AccessControlManagerV8` contract.\n */\ninterface IAccessControlManagerV8 is IAccessControl {\n function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;\n\n function revokeCallPermission(\n address contractAddress,\n string calldata functionSig,\n address accountToRevoke\n ) external;\n\n function isAllowedToCall(address account, string calldata functionSig) external view returns (bool);\n\n function hasPermission(\n address account,\n address contractAddress,\n string calldata functionSig\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface OracleInterface {\n function getPrice(address asset) external view returns (uint256);\n}\n\ninterface ResilientOracleInterface is OracleInterface {\n function updatePrice(address vToken) external;\n\n function updateAssetPrice(address asset) external;\n\n function getUnderlyingPrice(address vToken) external view returns (uint256);\n}\n\ninterface TwapInterface is OracleInterface {\n function updateTwap(address asset) external returns (uint256);\n}\n\ninterface BoundValidatorInterface {\n function validatePriceWithAnchorPrice(\n address asset,\n uint256 reporterPrice,\n uint256 anchorPrice\n ) external view returns (bool);\n}\n" + }, + "@venusprotocol/oracle/contracts/interfaces/VBep20Interface.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\n\ninterface VBep20Interface is IERC20Metadata {\n /**\n * @notice Underlying asset for this VToken\n */\n function underlying() external view returns (address);\n}\n" + }, + "@venusprotocol/oracle/contracts/ResilientOracle.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\n// SPDX-FileCopyrightText: 2022 Venus\npragma solidity 0.8.25;\n\nimport \"@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol\";\nimport \"./interfaces/VBep20Interface.sol\";\nimport \"./interfaces/OracleInterface.sol\";\nimport \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\n\n/**\n * @title ResilientOracle\n * @author Venus\n * @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.\n *\n * DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly\n * reported prices. If only one oracle is used, this creates a single point of failure and opens a vector\n * for attacking the protocol.\n *\n * The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect\n * the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle\n * and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.\n *\n * For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per\n * vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot\n * oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source.\n *\n * To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every\n * market. The upper bound ratio represents the deviation between reported price (the price that’s being\n * validated) and the anchor price (the price we are validating against) above which the reported price will\n * be invalidated. The lower bound ratio presents the deviation between reported price and anchor price below\n * which the reported price will be invalidated. So for oracle price to be considered valid the below statement\n * should be true:\n\n```\nanchorRatio = anchorPrice/reporterPrice\nisValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAnchorRatio\n```\n\n * In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending\n * on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may\n * use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles.\n *\n * For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the\n * oracle to be stagnant and treat it like it's disabled.\n */\ncontract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOracleInterface {\n /**\n * @dev Oracle roles:\n * **main**: The most trustworthy price source\n * **pivot**: Price oracle used as a loose sanity checker\n * **fallback**: The backup source when main oracle price is invalidated\n */\n enum OracleRole {\n MAIN,\n PIVOT,\n FALLBACK\n }\n\n struct TokenConfig {\n /// @notice asset address\n address asset;\n /// @notice `oracles` stores the oracles based on their role in the following order:\n /// [main, pivot, fallback],\n /// It can be indexed with the corresponding enum OracleRole value\n address[3] oracles;\n /// @notice `enableFlagsForOracles` stores the enabled state\n /// for each oracle in the same order as `oracles`\n bool[3] enableFlagsForOracles;\n }\n\n uint256 public constant INVALID_PRICE = 0;\n\n /// @notice Native market address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable nativeMarket;\n\n /// @notice VAI address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vai;\n\n /// @notice Set this as asset address for Native token on each chain.This is the underlying for vBNB (on bsc)\n /// and can serve as any underlying asset of a market that supports native tokens\n address public constant NATIVE_TOKEN_ADDR = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;\n\n /// @notice Bound validator contract address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n BoundValidatorInterface public immutable boundValidator;\n\n mapping(address => TokenConfig) private tokenConfigs;\n\n event TokenConfigAdded(\n address indexed asset,\n address indexed mainOracle,\n address indexed pivotOracle,\n address fallbackOracle\n );\n\n /// Event emitted when an oracle is set\n event OracleSet(address indexed asset, address indexed oracle, uint256 indexed role);\n\n /// Event emitted when an oracle is enabled or disabled\n event OracleEnabled(address indexed asset, uint256 indexed role, bool indexed enable);\n\n /**\n * @notice Checks whether an address is null or not\n */\n modifier notNullAddress(address someone) {\n if (someone == address(0)) revert(\"can't be zero address\");\n _;\n }\n\n /**\n * @notice Checks whether token config exists by checking whether asset is null address\n * @dev address can't be null, so it's suitable to be used to check the validity of the config\n * @param asset asset address\n */\n modifier checkTokenConfigExistence(address asset) {\n if (tokenConfigs[asset].asset == address(0)) revert(\"token config must exist\");\n _;\n }\n\n /// @notice Constructor for the implementation contract. Sets immutable variables.\n /// @dev nativeMarketAddress can be address(0) if on the chain we do not support native market\n /// (e.g vETH on ethereum would not be supported, only vWETH)\n /// @param nativeMarketAddress The address of a native market (for bsc it would be vBNB address)\n /// @param vaiAddress The address of the VAI token (if there is VAI on the deployed chain).\n /// Set to address(0) of VAI is not existent.\n /// @param _boundValidator Address of the bound validator contract\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address nativeMarketAddress,\n address vaiAddress,\n BoundValidatorInterface _boundValidator\n ) notNullAddress(address(_boundValidator)) {\n nativeMarket = nativeMarketAddress;\n vai = vaiAddress;\n boundValidator = _boundValidator;\n\n _disableInitializers();\n }\n\n /**\n * @notice Initializes the contract admin and sets the BoundValidator contract address\n * @param accessControlManager_ Address of the access control manager contract\n */\n function initialize(address accessControlManager_) external initializer {\n __AccessControlled_init(accessControlManager_);\n __Pausable_init();\n }\n\n /**\n * @notice Pauses oracle\n * @custom:access Only Governance\n */\n function pause() external {\n _checkAccessAllowed(\"pause()\");\n _pause();\n }\n\n /**\n * @notice Unpauses oracle\n * @custom:access Only Governance\n */\n function unpause() external {\n _checkAccessAllowed(\"unpause()\");\n _unpause();\n }\n\n /**\n * @notice Batch sets token configs\n * @param tokenConfigs_ Token config array\n * @custom:access Only Governance\n * @custom:error Throws a length error if the length of the token configs array is 0\n */\n function setTokenConfigs(TokenConfig[] memory tokenConfigs_) external {\n if (tokenConfigs_.length == 0) revert(\"length can't be 0\");\n uint256 numTokenConfigs = tokenConfigs_.length;\n for (uint256 i; i < numTokenConfigs; ) {\n setTokenConfig(tokenConfigs_[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @notice Sets oracle for a given asset and role.\n * @dev Supplied asset **must** exist and main oracle may not be null\n * @param asset Asset address\n * @param oracle Oracle address\n * @param role Oracle role\n * @custom:access Only Governance\n * @custom:error Null address error if main-role oracle address is null\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n * @custom:event Emits OracleSet event with asset address, oracle address and role of the oracle for the asset\n */\n function setOracle(\n address asset,\n address oracle,\n OracleRole role\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"setOracle(address,address,uint8)\");\n if (oracle == address(0) && role == OracleRole.MAIN) revert(\"can't set zero address to main oracle\");\n tokenConfigs[asset].oracles[uint256(role)] = oracle;\n emit OracleSet(asset, oracle, uint256(role));\n }\n\n /**\n * @notice Enables/ disables oracle for the input asset. Token config for the input asset **must** exist\n * @dev Configuration for the asset **must** already exist and the asset cannot be 0 address\n * @param asset Asset address\n * @param role Oracle role\n * @param enable Enabled boolean of the oracle\n * @custom:access Only Governance\n * @custom:error NotNullAddress error is thrown if asset address is null\n * @custom:error TokenConfigExistance error is thrown if token config is not set\n */\n function enableOracle(\n address asset,\n OracleRole role,\n bool enable\n ) external notNullAddress(asset) checkTokenConfigExistence(asset) {\n _checkAccessAllowed(\"enableOracle(address,uint8,bool)\");\n tokenConfigs[asset].enableFlagsForOracles[uint256(role)] = enable;\n emit OracleEnabled(asset, uint256(role), enable);\n }\n\n /**\n * @notice Updates the TWAP pivot oracle price.\n * @dev This function should always be called before calling getUnderlyingPrice\n * @param vToken vToken address\n */\n function updatePrice(address vToken) external override {\n address asset = _getUnderlyingAsset(vToken);\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @notice Updates the pivot oracle price. Currently using TWAP\n * @dev This function should always be called before calling getPrice\n * @param asset asset address\n */\n function updateAssetPrice(address asset) external {\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracle != address(0) && pivotOracleEnabled) {\n //if pivot oracle is not TwapOracle it will revert so we need to catch the revert\n try TwapInterface(pivotOracle).updateTwap(asset) {} catch {}\n }\n }\n\n /**\n * @dev Gets token config by asset address\n * @param asset asset address\n * @return tokenConfig Config for the asset\n */\n function getTokenConfig(address asset) external view returns (TokenConfig memory) {\n return tokenConfigs[asset];\n }\n\n /**\n * @notice Gets price of the underlying asset for a given vToken. Validation flow:\n * - Check if the oracle is paused globally\n * - Validate price from main oracle against pivot oracle\n * - Validate price from fallback oracle against pivot oracle if the first validation failed\n * - Validate price from main oracle against fallback oracle if the second validation failed\n * In the case that the pivot oracle is not available but main price is available and validation is successful,\n * main oracle price is returned.\n * @param vToken vToken address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getUnderlyingPrice(address vToken) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n\n address asset = _getUnderlyingAsset(vToken);\n return _getPrice(asset);\n }\n\n /**\n * @notice Gets price of the asset\n * @param asset asset address\n * @return price USD price in scaled decimal places.\n * @custom:error Paused error is thrown when resilent oracle is paused\n * @custom:error Invalid resilient oracle price error is thrown if fetched prices from oracle is invalid\n */\n function getPrice(address asset) external view override returns (uint256) {\n if (paused()) revert(\"resilient oracle is paused\");\n return _getPrice(asset);\n }\n\n /**\n * @notice Sets/resets single token configs.\n * @dev main oracle **must not** be a null address\n * @param tokenConfig Token config struct\n * @custom:access Only Governance\n * @custom:error NotNullAddress is thrown if asset address is null\n * @custom:error NotNullAddress is thrown if main-role oracle address for asset is null\n * @custom:event Emits TokenConfigAdded event when the asset config is set successfully by the authorized account\n */\n function setTokenConfig(\n TokenConfig memory tokenConfig\n ) public notNullAddress(tokenConfig.asset) notNullAddress(tokenConfig.oracles[uint256(OracleRole.MAIN)]) {\n _checkAccessAllowed(\"setTokenConfig(TokenConfig)\");\n\n tokenConfigs[tokenConfig.asset] = tokenConfig;\n emit TokenConfigAdded(\n tokenConfig.asset,\n tokenConfig.oracles[uint256(OracleRole.MAIN)],\n tokenConfig.oracles[uint256(OracleRole.PIVOT)],\n tokenConfig.oracles[uint256(OracleRole.FALLBACK)]\n );\n }\n\n /**\n * @notice Gets oracle and enabled status by asset address\n * @param asset asset address\n * @param role Oracle role\n * @return oracle Oracle address based on role\n * @return enabled Enabled flag of the oracle based on token config\n */\n function getOracle(address asset, OracleRole role) public view returns (address oracle, bool enabled) {\n oracle = tokenConfigs[asset].oracles[uint256(role)];\n enabled = tokenConfigs[asset].enableFlagsForOracles[uint256(role)];\n }\n\n function _getPrice(address asset) internal view returns (uint256) {\n uint256 pivotPrice = INVALID_PRICE;\n\n // Get pivot oracle price, Invalid price if not available or error\n (address pivotOracle, bool pivotOracleEnabled) = getOracle(asset, OracleRole.PIVOT);\n if (pivotOracleEnabled && pivotOracle != address(0)) {\n try OracleInterface(pivotOracle).getPrice(asset) returns (uint256 pricePivot) {\n pivotPrice = pricePivot;\n } catch {}\n }\n\n // Compare main price and pivot price, return main price and if validation was successful\n // note: In case pivot oracle is not available but main price is available and\n // validation is successful, the main oracle price is returned.\n (uint256 mainPrice, bool validatedPivotMain) = _getMainOraclePrice(\n asset,\n pivotPrice,\n pivotOracleEnabled && pivotOracle != address(0)\n );\n if (mainPrice != INVALID_PRICE && validatedPivotMain) return mainPrice;\n\n // Compare fallback and pivot if main oracle comparision fails with pivot\n // Return fallback price when fallback price is validated successfully with pivot oracle\n (uint256 fallbackPrice, bool validatedPivotFallback) = _getFallbackOraclePrice(asset, pivotPrice);\n if (fallbackPrice != INVALID_PRICE && validatedPivotFallback) return fallbackPrice;\n\n // Lastly compare main price and fallback price\n if (\n mainPrice != INVALID_PRICE &&\n fallbackPrice != INVALID_PRICE &&\n boundValidator.validatePriceWithAnchorPrice(asset, mainPrice, fallbackPrice)\n ) {\n return mainPrice;\n }\n\n revert(\"invalid resilient oracle price\");\n }\n\n /**\n * @notice Gets a price for the provided asset\n * @dev This function won't revert when price is 0, because the fallback oracle may still be\n * able to fetch a correct price\n * @param asset asset address\n * @param pivotPrice Pivot oracle price\n * @param pivotEnabled If pivot oracle is not empty and enabled\n * @return price USD price in scaled decimals\n * e.g. asset decimals is 8 then price is returned as 10**18 * 10**(18-8) = 10**28 decimals\n * @return pivotValidated Boolean representing if the validation of main oracle price\n * and pivot oracle price were successful\n * @custom:error Invalid price error is thrown if main oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if main oracle is not enabled or main oracle\n * address is null\n */\n function _getMainOraclePrice(\n address asset,\n uint256 pivotPrice,\n bool pivotEnabled\n ) internal view returns (uint256, bool) {\n (address mainOracle, bool mainOracleEnabled) = getOracle(asset, OracleRole.MAIN);\n if (mainOracleEnabled && mainOracle != address(0)) {\n try OracleInterface(mainOracle).getPrice(asset) returns (uint256 mainOraclePrice) {\n if (!pivotEnabled) {\n return (mainOraclePrice, true);\n }\n if (pivotPrice == INVALID_PRICE) {\n return (mainOraclePrice, false);\n }\n return (\n mainOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, mainOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function won't revert when the price is 0 because getPrice checks if price is > 0\n * @param asset asset address\n * @return price USD price in 18 decimals\n * @return pivotValidated Boolean representing if the validation of fallback oracle price\n * and pivot oracle price were successfully\n * @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset\n * @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle\n * address is null\n */\n function _getFallbackOraclePrice(address asset, uint256 pivotPrice) private view returns (uint256, bool) {\n (address fallbackOracle, bool fallbackEnabled) = getOracle(asset, OracleRole.FALLBACK);\n if (fallbackEnabled && fallbackOracle != address(0)) {\n try OracleInterface(fallbackOracle).getPrice(asset) returns (uint256 fallbackOraclePrice) {\n if (pivotPrice == INVALID_PRICE) {\n return (fallbackOraclePrice, false);\n }\n return (\n fallbackOraclePrice,\n boundValidator.validatePriceWithAnchorPrice(asset, fallbackOraclePrice, pivotPrice)\n );\n } catch {\n return (INVALID_PRICE, false);\n }\n }\n\n return (INVALID_PRICE, false);\n }\n\n /**\n * @dev This function returns the underlying asset of a vToken\n * @param vToken vToken address\n * @return asset underlying asset address\n */\n function _getUnderlyingAsset(address vToken) private view notNullAddress(vToken) returns (address asset) {\n if (vToken == nativeMarket) {\n asset = NATIVE_TOKEN_ADDR;\n } else if (vToken == vai) {\n asset = vai;\n } else {\n asset = VBep20Interface(vToken).underlying();\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/constants.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\nuint256 constant EXP_SCALE = 1e18;\n\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\nuint256 constant MANTISSA_ONE = EXP_SCALE;\n\n/// @dev The approximate number of seconds per year\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\n" + }, + "@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/**\n * @title MaxLoopsLimitHelper\n * @author Venus\n * @notice Abstract contract used to avoid collection with too many items that would generate gas errors and DoS.\n */\nabstract contract MaxLoopsLimitHelper {\n // Limit for the loops to avoid the DOS\n uint256 public maxLoopsLimit;\n\n /**\n * @dev This empty reserved space is put in place to allow future versions to add new\n * variables without shifting down storage in the inheritance chain.\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n */\n uint256[49] private __gap;\n\n /// @notice Emitted when max loops limit is set\n event MaxLoopsLimitUpdated(uint256 oldMaxLoopsLimit, uint256 newmaxLoopsLimit);\n\n /// @notice Thrown an error on maxLoopsLimit exceeds for any loop\n error MaxLoopsLimitExceeded(uint256 loopsLimit, uint256 requiredLoops);\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n */\n function _setMaxLoopsLimit(uint256 limit) internal {\n require(limit > maxLoopsLimit, \"Comptroller: Invalid maxLoopsLimit\");\n\n uint256 oldMaxLoopsLimit = maxLoopsLimit;\n maxLoopsLimit = limit;\n\n emit MaxLoopsLimitUpdated(oldMaxLoopsLimit, limit);\n }\n\n /**\n * @notice Compare the maxLoopsLimit with number of the times loop iterate\n * @param len Length of the loops iterate\n * @custom:error MaxLoopsLimitExceeded error is thrown when loops length exceeds maxLoopsLimit\n */\n function _ensureMaxLoops(uint256 len) internal view {\n if (len > maxLoopsLimit) {\n revert MaxLoopsLimitExceeded(maxLoopsLimit, len);\n }\n }\n}\n" + }, + "@venusprotocol/solidity-utilities/contracts/validators.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Thrown if the supplied address is a zero address where it is not allowed\nerror ZeroAddressNotAllowed();\n\n/// @notice Thrown if the supplied value is 0 where it is not allowed\nerror ZeroValueNotAllowed();\n\n/// @notice Checks if the provided address is nonzero, reverts otherwise\n/// @param address_ Address to check\n/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address\nfunction ensureNonzeroAddress(address address_) pure {\n if (address_ == address(0)) {\n revert ZeroAddressNotAllowed();\n }\n}\n\n/// @notice Checks if the provided value is nonzero, reverts otherwise\n/// @param value_ Value to check\n/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\nfunction ensureNonzeroValue(uint256 value_) pure {\n if (value_ == 0) {\n revert ZeroValueNotAllowed();\n }\n}\n" + }, + "contracts/hardhat-dependency-compiler/hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport 'hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol';\n" + }, + "contracts/hardhat-dependency-compiler/hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity >0.0.0;\nimport 'hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol';\n" + }, + "contracts/Interfaces/IComptroller.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IComptroller {\n function isComptroller() external view returns (bool);\n\n function markets(address) external view returns (bool);\n\n function getAllMarkets() external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { IAbstractTokenConverter } from \"../TokenConverter/IAbstractTokenConverter.sol\";\n\n/**\n * @title IConverterNetwork\n * @author Venus\n * @notice Interface implemented by `ConverterNetwork`.\n */\ninterface IConverterNetwork {\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external;\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance);\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory);\n\n /// @notice This function checks for given address is converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return boolean true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool);\n}\n" + }, + "contracts/Interfaces/IIncomeDestination.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IIncomeDestination {\n function updateAssetsState(address comptroller, address asset) external;\n}\n" + }, + "contracts/Interfaces/IPoolRegistry.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IPoolRegistry {\n /// @notice Get VToken in the Pool for an Asset\n function getVTokenForAsset(address comptroller, address asset) external view returns (address);\n\n /// @notice Get the addresss of the Pools supported that include a market for the provided asset\n function getPoolsSupportedByAsset(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IProtocolShareReserve {\n /// @notice it represents the type of vToken income\n enum IncomeType {\n SPREAD,\n LIQUIDATION\n }\n\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) external;\n}\n" + }, + "contracts/Interfaces/IRiskFund.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IRiskFund\n * @author Venus\n * @notice Interface implemented by `RiskFund`.\n */\ninterface IRiskFund {\n function transferReserveForAuction(address comptroller, uint256 amount) external returns (uint256);\n\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) external;\n\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256);\n}\n\n/**\n * @title IRiskFundGetters\n * @author Venus\n * @notice Interface implemented by `RiskFund` for getter methods.\n */\ninterface IRiskFundGetters {\n function convertibleBaseAsset() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IRiskFundConverter {\n function updateAssetsState(address comptroller, address asset) external;\n\n function getPools(address asset) external view returns (address[] memory);\n}\n" + }, + "contracts/Interfaces/IShortfall.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/**\n * @title IShortfall\n * @author Venus\n * @notice Interface implemented by `Shortfall`.\n */\ninterface IShortfall {\n function convertibleBaseAsset() external returns (address);\n}\n" + }, + "contracts/Interfaces/IVToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\ninterface IVToken {\n function underlying() external view returns (address);\n}\n" + }, + "contracts/Interfaces/IXVSVault.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\n/// @title IXVSVaultProxy\n/// @author Venus\n/// @notice Interface implemented by `XVSVault`.\ninterface IXVSVault {\n function xvsStore() external view returns (address);\n}\n" + }, + "contracts/ProtocolReserve/ProtocolShareReserve.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable, IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IProtocolShareReserve } from \"../Interfaces/IProtocolShareReserve.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\nimport { IIncomeDestination } from \"../Interfaces/IIncomeDestination.sol\";\n\nerror InvalidAddress();\nerror UnsupportedAsset();\nerror InvalidTotalPercentage();\nerror InvalidMaxLoopsLimit();\n\ncontract ProtocolShareReserve is\n AccessControlledV8,\n ReentrancyGuardUpgradeable,\n MaxLoopsLimitHelper,\n IProtocolShareReserve\n{\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice protocol income is categorized into two schemas.\n /// The first schema is for spread income\n /// The second schema is for liquidation income\n enum Schema {\n PROTOCOL_RESERVES,\n ADDITIONAL_REVENUE\n }\n\n struct DistributionConfig {\n Schema schema;\n /// @dev percenatge is represented without any scale\n uint16 percentage;\n address destination;\n }\n\n /// @notice address of core pool comptroller contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n /// @notice address of WBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable WBNB;\n\n /// @notice address of vBNB contract\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable vBNB;\n\n /// @notice address of pool registry contract\n address public poolRegistry;\n\n uint16 public constant MAX_PERCENT = 1e4;\n\n /// @notice comptroller => asset => schema => balance\n mapping(address => mapping(address => mapping(Schema => uint256))) public assetsReserves;\n\n /// @notice asset => balance\n mapping(address => uint256) public totalAssetReserve;\n\n /// @notice configuration for different income distribution targets\n DistributionConfig[] public distributionTargets;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Event emitted after updating of the assets reserves.\n event AssetsReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n uint256 amount,\n IncomeType incomeType,\n Schema schema\n );\n\n /// @notice Event emitted when an asset is released to a target\n event AssetReleased(\n address indexed destination,\n address indexed asset,\n Schema schema,\n uint256 percent,\n uint256 amount\n );\n\n /// @notice Event emitted when asset reserves state is updated\n event ReservesUpdated(\n address indexed comptroller,\n address indexed asset,\n Schema schema,\n uint256 oldBalance,\n uint256 newBalance\n );\n\n /// @notice Event emitted when distribution configuration is updated\n event DistributionConfigUpdated(\n address indexed destination,\n uint16 oldPercentage,\n uint16 newPercentage,\n Schema schema\n );\n\n /// @notice Event emitted when distribution configuration is added\n event DistributionConfigAdded(address indexed destination, uint16 percentage, Schema schema);\n\n /// @notice Event emitted when distribution configuration is removed\n event DistributionConfigRemoved(address indexed destination, uint16 percentage, Schema schema);\n\n /**\n * @dev Constructor to initialize the immutable variables\n * @param _corePoolComptroller The address of core pool comptroller\n * @param _wbnb The address of WBNB\n * @param _vbnb The address of vBNB\n */\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address _corePoolComptroller,\n address _wbnb,\n address _vbnb\n ) {\n ensureNonzeroAddress(_corePoolComptroller);\n ensureNonzeroAddress(_wbnb);\n ensureNonzeroAddress(_vbnb);\n\n CORE_POOL_COMPTROLLER = _corePoolComptroller;\n WBNB = _wbnb;\n vBNB = _vbnb;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /**\n * @dev Initializes the deployer to owner.\n * @param _accessControlManager The address of ACM contract\n * @param _loopsLimit Limit for the loops in the contract to avoid DOS\n */\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n __AccessControlled_init(_accessControlManager);\n __ReentrancyGuard_init();\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @dev Pool registry setter.\n * @param _poolRegistry Address of the pool registry\n * @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n */\n function setPoolRegistry(address _poolRegistry) external onlyOwner {\n ensureNonzeroAddress(_poolRegistry);\n emit PoolRegistryUpdated(poolRegistry, _poolRegistry);\n poolRegistry = _poolRegistry;\n }\n\n /**\n * @dev Add or update destination targets based on destination address\n * @param configs configurations of the destinations.\n */\n function addOrUpdateDistributionConfigs(DistributionConfig[] calldata configs) external nonReentrant {\n _checkAccessAllowed(\"addOrUpdateDistributionConfigs(DistributionConfig[])\");\n\n for (uint256 i = 0; i < configs.length; ) {\n DistributionConfig memory _config = configs[i];\n ensureNonzeroAddress(_config.destination);\n\n bool updated = false;\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 j = 0; j < distributionTargetsLength; ) {\n DistributionConfig storage config = distributionTargets[j];\n\n if (_config.schema == config.schema && config.destination == _config.destination) {\n emit DistributionConfigUpdated(\n _config.destination,\n config.percentage,\n _config.percentage,\n _config.schema\n );\n config.percentage = _config.percentage;\n updated = true;\n break;\n }\n\n unchecked {\n ++j;\n }\n }\n\n if (!updated) {\n distributionTargets.push(_config);\n emit DistributionConfigAdded(_config.destination, _config.percentage, _config.schema);\n }\n\n unchecked {\n ++i;\n }\n }\n\n _ensurePercentages();\n _ensureMaxLoops(distributionTargets.length);\n }\n\n /**\n * @dev Remove destionation target if percentage is 0\n * @param schema schema of the configuration\n * @param destination destination address of the configuration\n */\n function removeDistributionConfig(Schema schema, address destination) external {\n _checkAccessAllowed(\"removeDistributionConfig(Schema,address)\");\n\n uint256 distributionIndex;\n bool found = false;\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig storage config = distributionTargets[i];\n\n if (schema == config.schema && destination == config.destination && config.percentage == 0) {\n found = true;\n distributionIndex = i;\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n\n if (found) {\n emit DistributionConfigRemoved(\n distributionTargets[distributionIndex].destination,\n distributionTargets[distributionIndex].percentage,\n distributionTargets[distributionIndex].schema\n );\n\n distributionTargets[distributionIndex] = distributionTargets[distributionTargets.length - 1];\n distributionTargets.pop();\n }\n\n _ensurePercentages();\n }\n\n /**\n * @dev Release funds\n * @param comptroller the comptroller address of the pool\n * @param assets assets to be released to distribution targets\n */\n function releaseFunds(address comptroller, address[] calldata assets) external nonReentrant {\n for (uint256 i = 0; i < assets.length; ) {\n _releaseFund(comptroller, assets[i]);\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Used to find out the amount of funds that's going to be released when release funds is called.\n * @param comptroller the comptroller address of the pool\n * @param schema the schema of the distribution target\n * @param destination the destination address of the distribution target\n * @param asset the asset address which will be released\n */\n function getUnreleasedFunds(\n address comptroller,\n Schema schema,\n address destination,\n address asset\n ) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig storage _config = distributionTargets[i];\n if (_config.schema == schema && _config.destination == destination) {\n uint256 total = assetsReserves[comptroller][asset][schema];\n return (total * _config.percentage) / MAX_PERCENT;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Returns the total number of distribution targets\n */\n function totalDistributions() external view returns (uint256) {\n return distributionTargets.length;\n }\n\n /**\n * @dev Used to find out the percentage distribution for a particular destination based on schema\n * @param destination the destination address of the distribution target\n * @param schema the schema of the distribution target\n * @return percentage percentage distribution\n */\n function getPercentageDistribution(address destination, Schema schema) external view returns (uint256) {\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n\n if (config.destination == destination && config.schema == schema) {\n return config.percentage;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /**\n * @dev Update the reserve of the asset for the specific pool after transferring to the protocol share reserve.\n * @param comptroller Comptroller address (pool)\n * @param asset Asset address.\n * @param incomeType type of income\n */\n function updateAssetsState(\n address comptroller,\n address asset,\n IncomeType incomeType\n ) public override(IProtocolShareReserve) nonReentrant {\n if (!IComptroller(comptroller).isComptroller()) revert InvalidAddress();\n ensureNonzeroAddress(asset);\n\n if (\n comptroller != CORE_POOL_COMPTROLLER &&\n IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) == address(0)\n ) revert InvalidAddress();\n\n Schema schema = _getSchema(incomeType);\n uint256 currentBalance = IERC20Upgradeable(asset).balanceOf(address(this));\n uint256 assetReserve = totalAssetReserve[asset];\n\n if (currentBalance > assetReserve) {\n uint256 balanceDifference;\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n\n assetsReserves[comptroller][asset][schema] += balanceDifference;\n totalAssetReserve[asset] += balanceDifference;\n emit AssetsReservesUpdated(comptroller, asset, balanceDifference, incomeType, schema);\n }\n }\n\n /**\n * @dev asset from a particular pool to be release to distribution targets\n * @param comptroller Comptroller address(pool)\n * @param asset Asset address.\n */\n function _releaseFund(address comptroller, address asset) internal {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint256[] memory schemaBalances = new uint256[](totalSchemas);\n uint256 totalBalance;\n for (uint256 schemaValue; schemaValue < totalSchemas; ) {\n schemaBalances[schemaValue] = assetsReserves[comptroller][asset][Schema(schemaValue)];\n totalBalance += schemaBalances[schemaValue];\n\n unchecked {\n ++schemaValue;\n }\n }\n\n if (totalBalance == 0) {\n return;\n }\n\n uint256[] memory totalTransferAmounts = new uint256[](totalSchemas);\n for (uint256 i = 0; i < distributionTargets.length; ) {\n DistributionConfig memory _config = distributionTargets[i];\n\n uint256 transferAmount = (schemaBalances[uint256(_config.schema)] * _config.percentage) / MAX_PERCENT;\n totalTransferAmounts[uint256(_config.schema)] += transferAmount;\n\n if (transferAmount != 0) {\n IERC20Upgradeable(asset).safeTransfer(_config.destination, transferAmount);\n IIncomeDestination(_config.destination).updateAssetsState(comptroller, asset);\n\n emit AssetReleased(_config.destination, asset, _config.schema, _config.percentage, transferAmount);\n }\n\n unchecked {\n ++i;\n }\n }\n\n uint256[] memory newSchemaBalances = new uint256[](totalSchemas);\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n newSchemaBalances[schemaValue] = schemaBalances[schemaValue] - totalTransferAmounts[schemaValue];\n assetsReserves[comptroller][asset][Schema(schemaValue)] = newSchemaBalances[schemaValue];\n totalAssetReserve[asset] = totalAssetReserve[asset] - totalTransferAmounts[schemaValue];\n\n emit ReservesUpdated(\n comptroller,\n asset,\n Schema(schemaValue),\n schemaBalances[schemaValue],\n newSchemaBalances[schemaValue]\n );\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the schema based on income type\n * @param incomeType type of income\n * @return schema schema for distribution\n */\n function _getSchema(IncomeType incomeType) internal view returns (Schema schema) {\n schema = Schema.ADDITIONAL_REVENUE;\n\n if (incomeType == IncomeType.SPREAD) {\n schema = Schema.PROTOCOL_RESERVES;\n }\n }\n\n /**\n * @dev This ensures that the total percentage of all the distribution targets is 100% or 0%\n */\n function _ensurePercentages() internal view {\n uint256 totalSchemas = uint256(type(Schema).max) + 1;\n uint16[] memory totalPercentages = new uint16[](totalSchemas);\n\n uint256 distributionTargetsLength = distributionTargets.length;\n for (uint256 i = 0; i < distributionTargetsLength; ) {\n DistributionConfig memory config = distributionTargets[i];\n totalPercentages[uint256(config.schema)] += config.percentage;\n\n unchecked {\n ++i;\n }\n }\n for (uint256 schemaValue = 0; schemaValue < totalSchemas; ) {\n if (totalPercentages[schemaValue] != MAX_PERCENT && totalPercentages[schemaValue] != 0)\n revert InvalidTotalPercentage();\n\n unchecked {\n ++schemaValue;\n }\n }\n }\n\n /**\n * @dev Returns the underlying asset address for the vToken\n * @param vToken vToken address\n * @return asset address of asset\n */\n function _getUnderlying(address vToken) internal view returns (address) {\n if (vToken == vBNB) {\n return WBNB;\n } else {\n return IVToken(vToken).underlying();\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/RiskFundStorage.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { Ownable2StepUpgradeable } from \"@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\n\n/// @title ReserveHelpersStorage\n/// @author Venus\n/// @dev Reserve helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ReserveHelpersStorage is Ownable2StepUpgradeable {\n /// @notice Deprecated slot for assetReserves mapping\n bytes32 private __deprecatedSlot1;\n\n /// @notice Available asset's fund per pool in RiskFund\n /// Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolAssetsFunds;\n\n /// @notice Deprecated slot for poolRegistry address\n bytes32 private __deprecatedSlot2;\n /// @notice Deprecated slot for status variable\n bytes32 private __deprecatedSlot3;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n uint256[46] private __gap;\n}\n\n/// @title MaxLoopsLimitHelpersStorage\n/// @author Venus\n/// @dev Max loop limit helpers storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract MaxLoopsLimitHelpersStorage {\n /// @notice Limit for the loops to avoid the DOS\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 public maxLoopsLimit;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[49] private __gap;\n}\n\n/// @title RiskFundV1Storage\n/// @author Venus\n/// @dev Risk fund V1 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV1Storage is ReserveHelpersStorage, MaxLoopsLimitHelpersStorage {\n /// @notice Address of base asset\n address public convertibleBaseAsset;\n /// @notice Address of shortfall contract\n address public shortfall;\n\n /// @notice This state is deprecated, using it to prevent storage collision\n address private pancakeSwapRouter;\n /// @notice This state is deprecated, using it to prevent storage collision\n uint256 private minAmountToConvert;\n}\n\n/// @title RiskFundV2Storage\n/// @author Venus\n/// @dev Risk fund V2 storage\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2Storage is RiskFundV1Storage, ReentrancyGuardUpgradeable {\n /// @notice Risk fund converter address\n address public riskFundConverter;\n}\n" + }, + "contracts/ProtocolReserve/RiskFundV2.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IRiskFund } from \"../Interfaces/IRiskFund.sol\";\nimport { IRiskFundConverter } from \"../Interfaces/IRiskFundConverter.sol\";\nimport { RiskFundV2Storage } from \"./RiskFundStorage.sol\";\n\n/// @title RiskFundV2\n/// @author Venus\n/// @notice Contract with basic features to hold base asset for different Comptrollers\n/// @dev This contract does not support BNB\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundV2 is AccessControlledV8, RiskFundV2Storage, IRiskFund {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Emitted when convertible base asset address is updated\n event ConvertibleBaseAssetUpdated(address indexed oldConvertibleBaseAsset, address indexed newConvertibleBaseAsset);\n\n /// @notice Emitted when risk fund converter address is updated\n event RiskFundConverterUpdated(address indexed oldRiskFundConverter, address indexed newRiskFundConverter);\n\n /// @notice Emitted when shortfall contract address is updated\n event ShortfallContractUpdated(address indexed oldShortfallContract, address indexed newShortfallContract);\n\n /// @notice Emitted when reserves are transferred for auction\n event TransferredReserveForAuction(address indexed comptroller, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred to this contract\n event PoolAssetsIncreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emitted when pool asset states is updated with amount transferred from this contract on sweeping tokens\n event PoolAssetsDecreased(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Event emitted when tokens are swept and transferred from pool\n event SweepTokenFromPool(\n address indexed token,\n address indexed comptroller,\n address indexed receiver,\n uint256 amount\n );\n\n /// @notice Error is thrown when updatePoolState is not called by riskFundConverter\n error InvalidRiskFundConverter();\n\n /// @notice Error is thrown when transferReserveForAuction is called by non shortfall address\n error InvalidShortfallAddress();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice Error is thrown when pool reserve is less than the amount needed\n error InsufficientPoolReserve(address comptroller, uint256 amount, uint256 poolReserve);\n\n /// @dev Convertible base asset setter\n /// @param convertibleBaseAsset_ Address of the convertible base asset\n /// @custom:event ConvertibleBaseAssetUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when convertible base asset address is zero\n /// @custom:access Only Governance\n function setConvertibleBaseAsset(address convertibleBaseAsset_) external onlyOwner {\n ensureNonzeroAddress(convertibleBaseAsset_);\n emit ConvertibleBaseAssetUpdated(convertibleBaseAsset, convertibleBaseAsset_);\n convertibleBaseAsset = convertibleBaseAsset_;\n }\n\n /// @dev Risk fund converter setter\n /// @param riskFundConverter_ Address of the risk fund converter\n /// @custom:event RiskFundConverterUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when risk fund converter address is zero\n /// @custom:access Only Governance\n function setRiskFundConverter(address riskFundConverter_) external onlyOwner {\n ensureNonzeroAddress(riskFundConverter_);\n emit RiskFundConverterUpdated(riskFundConverter, riskFundConverter_);\n riskFundConverter = riskFundConverter_;\n }\n\n /// @dev Shortfall contract address setter\n /// @param shortfallContractAddress_ Address of the auction contract\n /// @custom:event ShortfallContractUpdated emit on success\n /// @custom:error ZeroAddressNotAllowed is thrown when shortfall contract address is zero\n /// @custom:access Only Governance\n function setShortfallContractAddress(address shortfallContractAddress_) external onlyOwner {\n ensureNonzeroAddress(shortfallContractAddress_);\n emit ShortfallContractUpdated(shortfall, shortfallContractAddress_);\n shortfall = shortfallContractAddress_;\n }\n\n /// @dev Transfer tokens for auction to shortfall contract\n /// @param comptroller Comptroller of the pool\n /// @param amount Amount to be transferred to the shortfall\n /// @return Amount of tokens transferred to the shortfall\n /// @custom:event TransferredReserveForAuction emit on success\n /// @custom:error InvalidShortfallAddress is thrown when caller is not shortfall contract\n /// @custom:error InsufficientPoolReserve is thrown when pool reserve is less than the amount needed\n /// @custom:access Only Shortfall contract\n function transferReserveForAuction(address comptroller, uint256 amount)\n external\n override\n nonReentrant\n returns (uint256)\n {\n uint256 poolReserve = poolAssetsFunds[comptroller][convertibleBaseAsset];\n\n if (msg.sender != shortfall) {\n revert InvalidShortfallAddress();\n }\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][convertibleBaseAsset] = poolReserve - amount;\n }\n\n IERC20Upgradeable(convertibleBaseAsset).safeTransfer(shortfall, amount);\n emit TransferredReserveForAuction(comptroller, amount);\n\n return amount;\n }\n\n /// @notice Function to sweep baseAsset for pool, Tokens are sent to address(to)\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep for the pool\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice Function to sweep token from pool\n /// @param tokenAddress Address of the asset(token)\n /// @param comptroller Pool address that the assets belong to\n /// @param receiver The receiver of the funds\n /// @param amount Amount need to sweep from the pool\n /// @custom:event Emits SweepTokenFromPool event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress, comptroller, or receiver address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Controlled by AccessControlManager\n function sweepTokenFromPool(\n address tokenAddress,\n address comptroller,\n address receiver,\n uint256 amount\n ) external nonReentrant {\n _checkAccessAllowed(\"sweepTokenFromPool(address,address,address,uint256)\");\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(comptroller);\n ensureNonzeroAddress(receiver);\n ensureNonzeroValue(amount);\n\n uint256 poolReserve = poolAssetsFunds[comptroller][tokenAddress];\n\n if (amount > poolReserve) {\n revert InsufficientPoolReserve(comptroller, amount, poolReserve);\n }\n\n unchecked {\n poolAssetsFunds[comptroller][tokenAddress] = poolReserve - amount;\n }\n\n IERC20Upgradeable(tokenAddress).safeTransfer(receiver, amount);\n\n emit SweepTokenFromPool(tokenAddress, comptroller, receiver, amount);\n }\n\n /**\n * @notice Get the Amount of the Base asset in the risk fund for the specific pool.\n * @param comptroller Comptroller address(pool).\n * @return Base Asset's reserve in risk fund.\n */\n function getPoolsBaseAssetReserves(address comptroller) external view returns (uint256) {\n return poolAssetsFunds[comptroller][convertibleBaseAsset];\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// @param comptroller Comptroller address (pool)\n /// @param asset Address of the asset(token)\n /// @param amount Amount transferred for the pool\n /// @custom:event PoolAssetsIncreased emits on success\n /// @custom:error InvalidRiskFundConverter is thrown if caller is not riskFundConverter contract\n /// @custom:access Only RiskFundConverter contract\n function updatePoolState(\n address comptroller,\n address asset,\n uint256 amount\n ) public {\n if (msg.sender != riskFundConverter) {\n revert InvalidRiskFundConverter();\n }\n\n poolAssetsFunds[comptroller][asset] += amount;\n emit PoolAssetsIncreased(comptroller, asset, amount);\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n function preSweepToken(address tokenAddress, uint256 amount) internal {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n\n address[] memory pools = IRiskFundConverter(riskFundConverter).getPools(tokenAddress);\n\n uint256 assetReserves;\n uint256 poolsLength = pools.length;\n for (uint256 i; i < poolsLength; ) {\n assetReserves += poolAssetsFunds[pools[i]][tokenAddress];\n unchecked {\n ++i;\n }\n }\n\n uint256 balanceDiff = balance - assetReserves;\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n uint256 distributedShare;\n for (uint256 i; i < poolsLength; ) {\n if (poolAssetsFunds[pools[i]][tokenAddress] != 0) {\n uint256 poolAmountShare;\n if (i < (poolsLength - 1)) {\n poolAmountShare = (poolAssetsFunds[pools[i]][tokenAddress] * amount) / assetReserves;\n distributedShare += poolAmountShare;\n } else {\n poolAmountShare = amountDiff - distributedShare;\n }\n poolAssetsFunds[pools[i]][tokenAddress] -= poolAmountShare;\n emit PoolAssetsDecreased(pools[i], tokenAddress, poolAmountShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n }\n}\n" + }, + "contracts/ProtocolReserve/XVSVaultTreasury.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { IXVSVault } from \"../Interfaces/IXVSVault.sol\";\n\n/// @title XVSVaultTreasury\n/// @author Venus\n/// @notice XVSVaultTreasury stores the tokens sent by SingleTokenConverter(XVS) and funds XVSVault\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract XVSVaultTreasury is AccessControlledV8, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice The xvs token address\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable XVS_ADDRESS;\n\n /// @notice The xvsvault address\n address public xvsVault;\n\n /// @notice Emitted when XVS vault address is updated\n event XVSVaultUpdated(address indexed oldXVSVault, address indexed newXVSVault);\n\n /// @notice Emitted when funds transferred to XVSStore address\n event FundsTransferredToXVSStore(address indexed xvsStore, uint256 amountMantissa);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Thrown when given input amount is zero\n error InsufficientBalance();\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n /// @param xvsAddress_ XVS token address\n constructor(address xvsAddress_) {\n ensureNonzeroAddress(xvsAddress_);\n XVS_ADDRESS = xvsAddress_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param xvsVault_ XVSVault address\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function initialize(address accessControlManager_, address xvsVault_) public initializer {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n _setXVSVault(xvsVault_);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function setXVSVault(address xvsVault_) external onlyOwner {\n _setXVSVault(xvsVault_);\n }\n\n /// @notice This function transfers funds to the XVS vault\n /// @param amountMantissa Amount to be sent to XVS vault\n /// @custom:event FundsTransferredToXVSStore emits on success\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance\n /// @custom:access Restricted by ACM\n function fundXVSVault(uint256 amountMantissa) external nonReentrant {\n _checkAccessAllowed(\"fundXVSVault(uint256)\");\n ensureNonzeroValue(amountMantissa);\n\n uint256 balance = IERC20Upgradeable(XVS_ADDRESS).balanceOf(address(this));\n\n if (balance < amountMantissa) {\n revert InsufficientBalance();\n }\n\n address xvsStore = IXVSVault(xvsVault).xvsStore();\n ensureNonzeroAddress(xvsStore);\n IERC20Upgradeable(XVS_ADDRESS).safeTransfer(xvsStore, amountMantissa);\n\n emit FundsTransferredToXVSStore(xvsStore, amountMantissa);\n }\n\n /// @notice Function to sweep tokens from the contract\n /// @param tokenAddress Address of the asset(token)\n /// @param to Address to which assets will be transferred\n /// @param amount Amount need to sweep from the contract\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:error ZeroValueNotAllowed is thrown when amount is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @dev XVS vault setter\n /// @param xvsVault_ Address of the XVS vault\n /// @custom:event XVSVaultUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when XVS vault address is zero\n function _setXVSVault(address xvsVault_) internal {\n ensureNonzeroAddress(xvsVault_);\n emit XVSVaultUpdated(xvsVault, xvsVault_);\n xvsVault = xvsVault_;\n }\n}\n" + }, + "contracts/Test/imports.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n// This file is needed to make hardhat and typechain generate artifacts for\n// contracts we depend on (e.g. in tests or deployments) but not use directly.\n// Another way to do this would be to use hardhat-dependency-compiler, but\n// since we only have a couple of dependencies, installing a separate package\n// seems an overhead.\n\nimport { UpgradeableBeacon } from \"@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol\";\nimport { BeaconProxy } from \"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\";\nimport { ProxyAdmin } from \"@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol\";\n" + }, + "contracts/Test/Mocks/MockACM.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControl } from \"@openzeppelin/contracts/access/AccessControl.sol\";\n\ncontract MockACM is AccessControl {\n /// @notice Emitted when an account is given a permission to a certain contract function\n /// @dev If contract address is 0x000..0 this means that the account is a default admin of this function and\n /// can call any contract function with this signature\n event PermissionGranted(address account, address contractAddress, string functionSig);\n\n /// @notice Emitted when an account is revoked a permission to a certain contract function\n event PermissionRevoked(address account, address contractAddress, string functionSig);\n\n constructor() {\n // Grant the contract deployer the default admin role: it will be able\n // to grant and revoke any roles\n _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);\n }\n\n /**\n * @notice Gives a function call permission to one single account\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * @param contractAddress address of contract for which call permissions will be granted\n * @dev if contractAddress is zero address, the account can access the specified function\n * on **any** contract managed by this ACL\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @param accountToPermit account that will be given access to the contract function\n * @custom:event Emits a {RoleGranted} and {PermissionGranted} events.\n */\n function giveCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToPermit\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n grantRole(role, accountToPermit);\n emit PermissionGranted(accountToPermit, contractAddress, functionSig);\n }\n\n /**\n * @notice Revokes an account's permission to a particular function call\n * @dev this function can be called only from Role Admin or DEFAULT_ADMIN_ROLE\n * \t\tMay emit a {RoleRevoked} event.\n * @param contractAddress address of contract for which call permissions will be revoked\n * @param functionSig signature e.g. \"functionName(uint256,bool)\"\n * @custom:event Emits {RoleRevoked} and {PermissionRevoked} events.\n */\n function revokeCallPermission(\n address contractAddress,\n string memory functionSig,\n address accountToRevoke\n ) public {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n revokeRole(role, accountToRevoke);\n emit PermissionRevoked(accountToRevoke, contractAddress, functionSig);\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev Since restricted contracts using this function as a permission hook, we can get contracts address with msg.sender\n * @param account for which call permissions will be checked\n * @param functionSig restricted function signature e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n *\n */\n function isAllowedToCall(address account, string memory functionSig) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(msg.sender, functionSig));\n\n if (hasRole(role, account)) {\n return true;\n } else {\n role = keccak256(abi.encodePacked(address(0), functionSig));\n return hasRole(role, account);\n }\n }\n\n /**\n * @notice Verifies if the given account can call a contract's guarded function\n * @dev This function is used as a view function to check permissions rather than contract hook for access restriction check.\n * @param account for which call permissions will be checked against\n * @param contractAddress address of the restricted contract\n * @param functionSig signature of the restricted function e.g. \"functionName(uint256,bool)\"\n * @return false if the user account cannot call the particular contract function\n */\n function hasPermission(\n address account,\n address contractAddress,\n string memory functionSig\n ) public view returns (bool) {\n bytes32 role = keccak256(abi.encodePacked(contractAddress, functionSig));\n return hasRole(role, account);\n }\n}\n" + }, + "contracts/Test/Mocks/MockArraySorter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\nimport { sort } from \"../../Utils/ArrayHelpers.sol\";\n\ncontract MockArraySorter {\n function sortArray(uint256[] memory balances, address[] memory addrs)\n external\n view\n returns (address[] memory, uint256[] memory)\n {\n sort(balances, addrs);\n return (addrs, balances);\n }\n}\n" + }, + "contracts/Test/Mocks/MockConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\n\nimport { AbstractTokenConverter } from \"../../TokenConverter/AbstractTokenConverter.sol\";\nimport { IRiskFundGetters } from \"../../Interfaces/IRiskFund.sol\";\n\ncontract MockConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) public assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) public poolsAssetsReserves;\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n function mockPrivateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 balanceDiff\n ) external {\n _privateConversion(comptroller, tokenAddressOut, balanceDiff);\n }\n\n function AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) public initializer {\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n assetsReserves[tokenAddressIn] += convertedTokenInBalance;\n poolsAssetsReserves[comptroller][tokenAddressIn] += convertedTokenInBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @notice Get base asset address\n function _getDestinationBaseAsset() internal view override returns (address) {\n return IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/Test/Mocks/MockDeflationaryToken.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\ncontract MockDeflatingToken {\n string public constant NAME = \"Deflating Test Token\";\n string public constant SYMBOL = \"DTT\";\n uint8 public constant DECIMALS = 18;\n uint256 public totalSupply;\n mapping(address => uint256) public balanceOf;\n mapping(address => mapping(address => uint256)) public allowance;\n\n bytes32 public immutable DOMAIN_SEPARATOR;\n // keccak256(\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\");\n bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;\n mapping(address => uint256) public nonces;\n\n event Approval(address indexed owner, address indexed spender, uint256 value);\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n constructor(uint256 _totalSupply) {\n uint256 chainId;\n assembly {\n chainId := chainid()\n }\n DOMAIN_SEPARATOR = keccak256(\n abi.encode(\n keccak256(\"EIP712Domain(string NAME,string version,uint256 chainId,address verifyingContract)\"),\n keccak256(bytes(NAME)),\n keccak256(bytes(\"1\")),\n chainId,\n address(this)\n )\n );\n _mint(msg.sender, _totalSupply);\n }\n\n function approve(address spender, uint256 value) external returns (bool) {\n _approve(msg.sender, spender, value);\n return true;\n }\n\n function transfer(address to, uint256 value) external returns (bool) {\n _transfer(msg.sender, to, value);\n return true;\n }\n\n function transferFrom(\n address from,\n address to,\n uint256 value\n ) external returns (bool) {\n if (allowance[from][msg.sender] != type(uint256).max) {\n allowance[from][msg.sender] = allowance[from][msg.sender] - value;\n }\n _transfer(from, to, value);\n return true;\n }\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 require(deadline >= block.timestamp, \"EXPIRED\");\n bytes32 digest = keccak256(\n abi.encodePacked(\n \"\\x19\\x01\",\n DOMAIN_SEPARATOR,\n keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline))\n )\n );\n address recoveredAddress = ecrecover(digest, v, r, s);\n require(recoveredAddress != address(0) && recoveredAddress == owner, \"INVALID_SIGNATURE\");\n _approve(owner, spender, value);\n }\n\n function _mint(address to, uint256 value) internal {\n totalSupply = totalSupply + value;\n balanceOf[to] = balanceOf[to] + value;\n emit Transfer(address(0), to, value);\n }\n\n function _burn(address from, uint256 value) internal {\n balanceOf[from] = balanceOf[from] - value;\n totalSupply = totalSupply - value;\n emit Transfer(from, address(0), value);\n }\n\n function _approve(\n address owner,\n address spender,\n uint256 value\n ) private {\n allowance[owner][spender] = value;\n emit Approval(owner, spender, value);\n }\n\n function _transfer(\n address from,\n address to,\n uint256 value\n ) private {\n uint256 burnAmount = value / 100;\n _burn(from, burnAmount);\n uint256 transferAmount = value - burnAmount;\n balanceOf[from] = balanceOf[from] - transferAmount;\n balanceOf[to] = balanceOf[to] + transferAmount;\n emit Transfer(from, to, transferAmount);\n }\n}\n" + }, + "contracts/Test/Mocks/MockRiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { RiskFundConverter } from \"../../TokenConverter/RiskFundConverter.sol\";\n\ncontract MockRiskFundConverter is RiskFundConverter {\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) RiskFundConverter(corePoolComptroller_, vBNB_, nativeWrapped_) {}\n\n function postConversionHookMock(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) external {\n super._postConversionHook(tokenInAddress, tokenOutAddress, amountIn, amountOut);\n }\n\n function preTransferHookMock(address tokenOutAddress, uint256 amountOut) external {\n super._preTransferHook(tokenOutAddress, amountOut);\n }\n\n function setAssetsReserves(address asset, uint256 amount) external {\n assetsReserves[asset] = amount;\n }\n\n function setPoolsAssetsReserves(\n address comptroller,\n address asset,\n uint256 amount\n ) external {\n poolsAssetsReserves[comptroller][asset] = amount;\n }\n\n function getPoolsAssetsReserves(address comptroller, address asset) external view returns (uint256) {\n return poolsAssetsReserves[comptroller][asset];\n }\n\n function getAssetsReserves(address asset) external view returns (uint256) {\n return assetsReserves[asset];\n }\n}\n" + }, + "contracts/Test/Mocks/MockToken.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)\n\npragma solidity 0.8.25;\n\nimport { ERC20 } from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract MockToken is ERC20 {\n uint8 private immutable _decimals;\n\n constructor(\n string memory name_,\n string memory symbol_,\n uint8 decimals_\n ) ERC20(name_, symbol_) {\n _decimals = decimals_;\n }\n\n function faucet(uint256 amount) external {\n _mint(msg.sender, amount);\n }\n\n function allocateTo(address owner, uint256 amount) external {\n _mint(owner, amount);\n }\n\n function decimals() public view virtual override returns (uint8) {\n return _decimals;\n }\n}\n" + }, + "contracts/TokenConverter/AbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { ReentrancyGuardUpgradeable } from \"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\";\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\nimport { MANTISSA_ONE, EXP_SCALE } from \"@venusprotocol/solidity-utilities/contracts/constants.sol\";\n\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title AbstractTokenConverter\n/// @author Venus\n/// @notice Abstract contract will be extended by SingleTokenConverter and RiskFundConverter\n/*\n * This contract specifies four functions for converting tokens, each applicable under following circumstances:\n *\n * Case I: TokenIn -> deflationary token, TokenOut -> deflationary token\n * In this scenario, functions supporting fees can only be utilized to convert tokens which are:\n * a. convertExactTokensSupportingFeeOnTransferTokens\n * b. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case II: TokenIn -> deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions supporting fee can only be utilized to convert tokens which are:\n * similar to Case I.\n *\n * Case III: TokenIn -> non-deflationary token, TokenOut -> deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * a. convertExactTokens\n * b. convertForExactTokens\n * c. convertExactTokensSupportingFeeOnTransferTokens\n * d. convertForExactTokensSupportingFeeOnTransferTokens\n *\n * Case IV: TokenIn -> non-deflationary token, TokenOut -> non-deflationary token\n * In this scenario, functions with or without supporting fee can be utilized to convert tokens which are:\n * similar to Case III.\n *\n * ------------------------------------------------------------------------------------------------------------------------------------\n * Example 1:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInAmount - 100\n * tokenOutMinAmount - minimum amount desired by the user(let's say 70)\n * Here user can use `convertExactTokens` or `convertExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertExactTokens` is used).\n * Now first tokenInAddress tokens will be transferred from the user to the contract, on the basis of amount\n * received(as tokenInAddress can be deflationary token) tokenAmountOut will be calculated and will be transferred\n * to the user and if amount sent is less than tokenOutMinAmount, tx will revert. If amount sent is satisfied(let's say\n * 80 or even 70) then at last the actual amount received and the amount that was supposed to be received by the contract will\n * be compared, if they differ then the whole tx will revert as user was supposed to use `convertExactTokensSupportingFeeOnTransferTokens`\n * function for tokenIn as deflationary token.\n *\n * Example 2:-\n * tokenInAddress - 0xaaaa.....\n * tokenOutAddress - 0xbbbb.....\n * tokenInMaxAmount - maximum amount user is willing to provide(let's say 100)\n * tokenOutAmount - 70\n * Here user can use `convertForExactTokens` or `convertForExactTokensSupportingFeeOnTransferTokens`, if tokenIn is deflationary\n * then `convertForExactTokensSupportingFeeOnTransferTokens` should be used(let's suppose `convertForExactTokens` is used),\n * which on the basis of tokenOutAmount provided will calculate tokenInAmount based on the tokens prices and will transfer\n * tokens from the user to the contract, now the actual amount received(as tokenInAddress can be deflationary token) will be\n * compared with tokenInMaxAmount if it is greater, tx will revert. If In amount is satisfied(let's say 90 or even 100) then\n * new tokenOutAmount will be calculated, and tokenOutAddress tokens will be transferred to the user, but at last the\n * old tokenOutAmount and new tokenOutAmount will be compared and if they differ whole tx will revert, because user was\n * supposed to use `convertForExactTokensSupportingFeeOnTransferTokens` function for tokenIn as deflationary token.\n * ------------------------------------------------------------------------------------------------------------------------------------\n *\n * This contract also supports private conversion between the converters:\n * Private conversions:\n * Private conversions is designed in order to convert the maximum amount of tokens received from PSR(to any converter) between\n * existing converters to save incentive and lower the dependency of users for conversion. So Private Conversion will be executed\n * by converters on it's own whenever funds are received from PSR. No incentive will be offered during private conversion.\n *\n * It will execute on updateAssetsState() function call in Converter Contracts. After this function call, converter will first\n * check for the amount received. If base asset is received then it will be directly sent to the destination address and no private\n * conversion will happen otherwise converter will interact with ConverterNetwork contract to find other valid converters who are providing the conversion for:\n *\n * tokenAddressIn: As asset received by that converter on updateAssetsState() function call.\n * tokenAddressOut: As base asset of that converter.\n *\n * ConverterNetwork:\n * This contract will contain all the converters, and will provide valid converters which can perform the execution according to tokenAddressIn\n * and tokenAddressOut provided.\n *\n * findTokenConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for users).\n *\n * findTokenConvertersForConverters():\n * It will return an array of converter addresses along with their corresponding balances, sorted in descending order based on the converter's balances\n * relative to tokenAddressOut. This function filter the converter addresses on the basis of the conversionAccess(for converters).\n */\n\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\nabstract contract AbstractTokenConverter is AccessControlledV8, IAbstractTokenConverter, ReentrancyGuardUpgradeable {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Maximum incentive could be\n uint256 public constant MAX_INCENTIVE = 0.5e18;\n\n /// @notice Min amount to convert for private conversions. Defined in USD, with 18 decimals\n uint256 public minAmountToConvert;\n\n /// @notice Venus price oracle contract\n ResilientOracle public priceOracle;\n\n /// @notice conversion configurations for the existing pairs\n /// @dev tokenAddressIn => tokenAddressOut => ConversionConfig\n mapping(address => mapping(address => ConversionConfig)) public conversionConfigurations;\n\n /// @notice Address that all incoming tokens are transferred to\n address public destinationAddress;\n\n /// @notice Boolean for if conversion is paused\n bool public conversionPaused;\n\n /// @notice Address of the converterNetwork contract\n IConverterNetwork public converterNetwork;\n\n /// @dev This empty reserved space is put in place to allow future versions to add new\n /// variables without shifting down storage in the inheritance chain.\n /// See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n uint256[45] private __gap;\n\n /// @notice Emitted when config is updated for tokens pair\n event ConversionConfigUpdated(\n address indexed tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 oldIncentive,\n uint256 newIncentive,\n ConversionAccessibility oldAccess,\n ConversionAccessibility newAccess\n );\n /// @notice Emitted when price oracle address is updated\n event PriceOracleUpdated(ResilientOracle indexed oldPriceOracle, ResilientOracle indexed priceOracle);\n\n /// @notice Emitted when destination address is updated\n event DestinationAddressUpdated(address indexed oldDestinationAddress, address indexed destinationAddress);\n\n /// @notice Emitted when converterNetwork address is updated\n event ConverterNetworkAddressUpdated(address indexed oldConverterNetwork, address indexed converterNetwork);\n\n /// @notice Emitted when exact amount of tokens are converted for tokens\n event ConvertedExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens\n event ConvertedForExactTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when exact amount of tokens are converted for tokens, for deflationary tokens\n event ConvertedExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when tokens are converted for exact amount of tokens, for deflationary tokens\n event ConvertedForExactTokensSupportingFeeOnTransferTokens(\n address indexed sender,\n address indexed receiver,\n address tokenAddressIn,\n address indexed tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n );\n\n /// @notice Emitted when conversion is paused\n event ConversionPaused(address indexed sender);\n\n /// @notice Emitted when conversion is unpaused\n event ConversionResumed(address indexed sender);\n\n /// @notice Event emitted when tokens are swept\n event SweepToken(address indexed token, address indexed to, uint256 amount);\n\n /// @notice Emitted when minimum amount to convert is updated\n event MinAmountToConvertUpdated(uint256 oldMinAmountToConvert, uint256 newMinAmountToConvert);\n\n /// @notice Thrown when actualAmountOut does not match with amountOutMantissa for convertForExactTokens\n error AmountOutMismatched();\n\n /// @notice Thrown when actualAmountIn does not match with amountInMantissa for convertForExactTokens\n error AmountInMismatched();\n\n /// @notice Thrown when given input amount is zero\n error InsufficientInputAmount();\n\n /// @notice Thrown when given output amount is zero\n error InsufficientOutputAmount();\n\n /// @notice Thrown when conversion is disabled or config does not exist for given pair\n error ConversionConfigNotEnabled();\n\n /// @notice Thrown when conversion is enabled only for private conversions\n error ConversionEnabledOnlyForPrivateConversions();\n\n /// @notice Thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n error InvalidToAddress();\n\n /// @notice Thrown when incentive is higher than the MAX_INCENTIVE\n error IncentiveTooHigh(uint256 incentive, uint256 maxIncentive);\n\n /// @notice Thrown when amountOut is lower than amountOutMin\n error AmountOutLowerThanMinRequired(uint256 amountOutMantissa, uint256 amountOutMinMantissa);\n\n /// @notice Thrown when amountIn is higher than amountInMax\n error AmountInHigherThanMax(uint256 amountInMantissa, uint256 amountInMaxMantissa);\n\n /// @notice Thrown when conversion is paused\n error ConversionTokensPaused();\n\n /// @notice Thrown when conversion is Active\n error ConversionTokensActive();\n\n /// @notice Thrown when tokenInAddress is same as tokeOutAdress OR tokeInAddress is not the base asset of the destination\n error InvalidTokenConfigAddresses();\n\n /// @notice Thrown when contract has less liquidity for tokenAddressOut than amountOutMantissa\n error InsufficientPoolLiquidity();\n\n /// @notice When address of the ConverterNetwork is not set or Zero address\n error InvalidConverterNetwork();\n\n /// @notice Thrown when trying to set non zero incentive for private conversion\n error NonZeroIncentiveForPrivateConversion();\n\n /// @notice Thrown when using convertForExactTokens deflationary tokens\n error DeflationaryTokenNotSupported();\n\n /// @notice Thrown when minimum amount to convert is zero\n error InvalidMinimumAmountToConvert();\n\n /// @notice Thrown when there is a mismatch in the length of input arrays\n error InputLengthMisMatch();\n\n /**\n * @notice Modifier to ensure valid conversion parameters for a token conversion\n * and check if conversion is paused or not\n * @param to The recipient address for the converted tokens\n * @param tokenAddressIn The input token address for the conversion\n * @param tokenAddressOut The output token address for the conversion\n */\n modifier validConversionParameters(\n address to,\n address tokenAddressIn,\n address tokenAddressOut\n ) {\n _checkConversionPaused();\n ensureNonzeroAddress(to);\n if (to == tokenAddressIn || to == tokenAddressOut) {\n revert InvalidToAddress();\n }\n _;\n }\n\n /// @notice Pause conversion of tokens\n /// @custom:event Emits ConversionPaused on success\n /// @custom:error ConversionTokensPaused thrown when conversion is already paused\n /// @custom:access Restricted by ACM\n function pauseConversion() external {\n _checkAccessAllowed(\"pauseConversion()\");\n _checkConversionPaused();\n conversionPaused = true;\n emit ConversionPaused(msg.sender);\n }\n\n /// @notice Resume conversion of tokens.\n /// @custom:event Emits ConversionResumed on success\n /// @custom:error ConversionTokensActive thrown when conversion is already active\n /// @custom:access Restricted by ACM\n function resumeConversion() external {\n _checkAccessAllowed(\"resumeConversion()\");\n if (!conversionPaused) {\n revert ConversionTokensActive();\n }\n\n conversionPaused = false;\n emit ConversionResumed(msg.sender);\n }\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:access Only Governance\n function setPriceOracle(ResilientOracle priceOracle_) external onlyOwner {\n _setPriceOracle(priceOracle_);\n }\n\n /// @notice Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:access Only Governance\n function setDestination(address destinationAddress_) external onlyOwner {\n _setDestination(destinationAddress_);\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:access Only Governance\n function setConverterNetwork(IConverterNetwork converterNetwork_) external onlyOwner {\n _setConverterNetwork(converterNetwork_);\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:access Only Governance\n function setMinAmountToConvert(uint256 minAmountToConvert_) external {\n _checkAccessAllowed(\"setMinAmountToConvert(uint256)\");\n _setMinAmountToConvert(minAmountToConvert_);\n }\n\n /// @notice Batch sets the conversion configurations\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressesOut Array of addresses of tokenOut\n /// @param conversionConfigs Array of conversionConfig config details to update\n /// @custom:error InputLengthMisMatch is thrown when tokenAddressesOut and conversionConfigs array length mismatches\n function setConversionConfigs(\n address tokenAddressIn,\n address[] calldata tokenAddressesOut,\n ConversionConfig[] calldata conversionConfigs\n ) external {\n uint256 tokenOutArrayLength = tokenAddressesOut.length;\n if (tokenOutArrayLength != conversionConfigs.length) revert InputLengthMisMatch();\n\n for (uint256 i; i < tokenOutArrayLength; ) {\n setConversionConfig(tokenAddressIn, tokenAddressesOut[i], conversionConfigs[i]);\n unchecked {\n ++i;\n }\n }\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n /// @custom:error AmountInMismatched error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountIn != amountInMantissa) {\n revert AmountInMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts tokens for tokenAddressIn for exact amount of tokenAddressOut if there is enough tokens held by the contract,\n /// otherwise the amount is adjusted\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n /// @custom:error AmountOutMismatched error is thrown when actualAmountOut is does not match amountOutMantissa\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n if (actualAmountOut != amountOutMantissa) {\n revert AmountOutMismatched();\n }\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokens(msg.sender, to, tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n }\n\n /// @notice Converts exact amount of tokenAddressIn for tokenAddressOut if there is enough tokens held by the contract\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertExactTokens(\n amountInMantissa,\n amountOutMinMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice Converts tokens for tokenAddressIn for amount of tokenAddressOut calculated on the basis of amount of\n /// tokenAddressIn received by the contract, if there is enough tokens held by the contract, otherwise the amount is adjusted.\n /// The user will be responsible for bearing any fees associated with token transfers, whether pulling in or pushing out tokens\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount transferred to destination\n /// @return actualAmountOut Actual amount transferred to user\n /// @custom:event Emits ConvertedForExactTokensSupportingFeeOnTransferTokens event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when to address is zero\n /// @custom:error InvalidToAddress error is thrown when address(to) is same as tokenAddressIn or tokenAddressOut\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n )\n external\n validConversionParameters(to, tokenAddressIn, tokenAddressOut)\n nonReentrant\n returns (uint256 actualAmountIn, uint256 actualAmountOut)\n {\n (actualAmountIn, actualAmountOut) = _convertForExactTokensSupportingFeeOnTransferTokens(\n amountInMaxMantissa,\n amountOutMantissa,\n tokenAddressIn,\n tokenAddressOut,\n to\n );\n\n _postConversionHook(tokenAddressIn, tokenAddressOut, actualAmountIn, actualAmountOut);\n emit ConvertedForExactTokensSupportingFeeOnTransferTokens(\n msg.sender,\n to,\n tokenAddressIn,\n tokenAddressOut,\n actualAmountIn,\n actualAmountOut\n );\n }\n\n /// @notice To sweep ERC20 tokens and transfer them to user(to address)\n /// @param tokenAddress The address of the ERC-20 token to sweep\n /// @param to The address to which tokens will be transferred\n /// @param amount The amount to transfer\n /// @custom:event Emits SweepToken event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when tokenAddress/to address is zero\n /// @custom:access Only Governance\n function sweepToken(\n address tokenAddress,\n address to,\n uint256 amount\n ) external onlyOwner nonReentrant {\n ensureNonzeroAddress(tokenAddress);\n ensureNonzeroAddress(to);\n ensureNonzeroValue(amount);\n\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n preSweepToken(tokenAddress, amount);\n token.safeTransfer(to, amount);\n\n emit SweepToken(tokenAddress, to, amount);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @notice The amountInMantissa might be adjusted if amountOutMantissa is greater than the balance of the contract for tokenAddressOut\n /// @dev This function retrieves values without altering token prices\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n amountConvertedMantissa = amountInMantissa;\n uint256 tokenInToOutConversion;\n (amountOutMantissa, tokenInToOutConversion) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountConvertedMantissa = _divRoundingUp(maxTokenOutReserve * EXP_SCALE, tokenInToOutConversion);\n amountOutMantissa = maxTokenOutReserve;\n }\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut.\n /// This function does not account for potential token transfer fees(in case of deflationary tokens)\n /// @dev This function retrieves values without altering token prices\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n if (\n conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountOutMantissa) {\n amountOutMantissa = maxTokenOutReserve;\n }\n\n amountConvertedMantissa = amountOutMantissa;\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountOutMantissa, ) = _getAmountOut(amountInMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountInMantissa;\n }\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) public returns (uint256 amountConvertedMantissa, uint256 amountInMantissa) {\n priceOracle.updateAssetPrice(tokenAddressIn);\n priceOracle.updateAssetPrice(tokenAddressOut);\n\n (amountInMantissa, ) = _getAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n amountConvertedMantissa = amountOutMantissa;\n }\n\n /// @notice This method updated the states of this contract after getting funds from PSR\n /// after settling the amount(if any) through privateConversion between converters\n /// @dev This function is called by protocolShareReserve\n /// @dev call _updateAssetsState to update the states related to the comptroller and asset transfer to the specific converter then\n /// it calls the _privateConversion which will convert the asset into destination's base asset and transfer it to destination address\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n function updateAssetsState(address comptroller, address asset) public nonReentrant {\n uint256 balanceDiff = _updateAssetsState(comptroller, asset);\n if (balanceDiff > 0) {\n _privateConversion(comptroller, asset, balanceDiff);\n }\n }\n\n /// @notice Set the configuration for new or existing conversion pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n /// @custom:event Emits ConversionConfigUpdated event on success\n /// @custom:error Unauthorized error is thrown when the call is not authorized by AccessControlManager\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:error NonZeroIncentiveForPrivateConversion is thrown when incentive is non zero for private conversion\n /// @custom:access Controlled by AccessControlManager\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) public {\n _checkAccessAllowed(\"setConversionConfig(address,address,ConversionConfig)\");\n ensureNonzeroAddress(tokenAddressIn);\n ensureNonzeroAddress(tokenAddressOut);\n\n if (conversionConfig.incentive > MAX_INCENTIVE) {\n revert IncentiveTooHigh(conversionConfig.incentive, MAX_INCENTIVE);\n }\n\n if (\n (tokenAddressIn == tokenAddressOut) ||\n (tokenAddressIn != _getDestinationBaseAsset()) ||\n conversionConfigurations[tokenAddressOut][tokenAddressIn].conversionAccess != ConversionAccessibility.NONE\n ) {\n revert InvalidTokenConfigAddresses();\n }\n\n if (\n (conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) &&\n conversionConfig.incentive != 0\n ) {\n revert NonZeroIncentiveForPrivateConversion();\n }\n\n if (\n ((conversionConfig.conversionAccess == ConversionAccessibility.ONLY_FOR_CONVERTERS) ||\n (conversionConfig.conversionAccess == ConversionAccessibility.ALL)) &&\n (address(converterNetwork) == address(0))\n ) {\n revert InvalidConverterNetwork();\n }\n\n ConversionConfig storage configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n emit ConversionConfigUpdated(\n tokenAddressIn,\n tokenAddressOut,\n configuration.incentive,\n conversionConfig.incentive,\n configuration.conversionAccess,\n conversionConfig.conversionAccess\n );\n\n if (conversionConfig.conversionAccess == ConversionAccessibility.NONE) {\n delete conversionConfigurations[tokenAddressIn][tokenAddressOut];\n } else {\n configuration.incentive = conversionConfig.incentive;\n configuration.conversionAccess = conversionConfig.conversionAccess;\n }\n }\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) public view virtual returns (uint256 tokenBalance);\n\n /// @dev Operations to perform before sweeping tokens\n /// @param token Address of the token\n /// @param amount Amount transferred to address(to)\n function preSweepToken(address token, uint256 amount) internal virtual {}\n\n /// @dev Converts exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return amountOutMantissa Actual amount of tokenAddressOut transferred\n /// @custom:error AmountOutLowerThanMinRequired error is thrown when amount of output tokenAddressOut is less than amountOutMinMantissa\n function _convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 amountOutMantissa) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, amountOutMantissa) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n if (amountOutMantissa < amountOutMinMantissa) {\n revert AmountOutLowerThanMinRequired(amountOutMantissa, amountOutMinMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n }\n\n /// @dev Converts tokens for tokenAddressIn for exact amount of tokenAddressOut used for non deflationry tokens\n /// it is called by convertForExactTokens function\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error DeflationaryTokenNotSupported is thrown if tokenAddressIn is deflationary token\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n if (actualAmountIn != amountInMantissa) {\n revert DeflationaryTokenNotSupported();\n }\n\n if (actualAmountIn > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n _doTransferOut(tokenAddressOut, to, amountOutMantissa);\n actualAmountOut = amountOutMantissa;\n }\n\n /// @dev Converts tokens for tokenAddressIn for the amount of tokenAddressOut used for deflationary tokens\n /// it is called by convertForExactTokensSupportingFeeOnTransferTokens function\n /// @notice Advising users to input a smaller amountOutMantissa to avoid potential transaction revert\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @return actualAmountIn Actual amount of tokenAddressIn transferred\n /// @return actualAmountOut Actual amount of tokenAddressOut transferred\n /// @custom:error AmountInHigherThanMax error is thrown when amount of tokenAddressIn is higher than amountInMaxMantissa\n function _convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) internal returns (uint256 actualAmountIn, uint256 actualAmountOut) {\n _checkPrivateConversion(tokenAddressIn, tokenAddressOut);\n (, uint256 amountInMantissa) = getUpdatedAmountIn(amountOutMantissa, tokenAddressIn, tokenAddressOut);\n\n if (amountInMantissa > amountInMaxMantissa) {\n revert AmountInHigherThanMax(amountInMantissa, amountInMaxMantissa);\n }\n\n actualAmountIn = _doTransferIn(tokenAddressIn, amountInMantissa);\n\n (, actualAmountOut) = getUpdatedAmountOut(actualAmountIn, tokenAddressIn, tokenAddressOut);\n\n _doTransferOut(tokenAddressOut, to, actualAmountOut);\n }\n\n /// @dev return actualAmountOut from reserves for tokenAddressOut\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param to Address of the tokenAddressOut receiver\n /// @param amountConvertedMantissa Amount of tokenAddressOut supposed to get transferred\n /// @custom:error InsufficientPoolLiquidity If contract has less liquidity for tokenAddressOut than amountOutMantissa\n function _doTransferOut(\n address tokenAddressOut,\n address to,\n uint256 amountConvertedMantissa\n ) internal {\n uint256 maxTokenOutReserve = balanceOf(tokenAddressOut);\n\n /// If contract has less liquidity for tokenAddressOut than amountOutMantissa\n if (maxTokenOutReserve < amountConvertedMantissa) {\n revert InsufficientPoolLiquidity();\n }\n\n _preTransferHook(tokenAddressOut, amountConvertedMantissa);\n\n IERC20Upgradeable tokenOut = IERC20Upgradeable(tokenAddressOut);\n tokenOut.safeTransfer(to, amountConvertedMantissa);\n }\n\n /// @notice Transfer tokenAddressIn from user to destination\n /// @param tokenAddressIn Address of the token to convert\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @return actualAmountIn Actual amount transferred to destination\n function _doTransferIn(address tokenAddressIn, uint256 amountInMantissa) internal returns (uint256 actualAmountIn) {\n IERC20Upgradeable tokenIn = IERC20Upgradeable(tokenAddressIn);\n uint256 balanceBeforeDestination = tokenIn.balanceOf(destinationAddress);\n tokenIn.safeTransferFrom(msg.sender, destinationAddress, amountInMantissa);\n uint256 balanceAfterDestination = tokenIn.balanceOf(destinationAddress);\n actualAmountIn = balanceAfterDestination - balanceBeforeDestination;\n }\n\n /// @dev Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n /// @custom:event Emits PriceOracleUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when price oracle address is zero\n function _setPriceOracle(ResilientOracle priceOracle_) internal {\n ensureNonzeroAddress(address(priceOracle_));\n emit PriceOracleUpdated(priceOracle, priceOracle_);\n priceOracle = priceOracle_;\n }\n\n /// @dev Sets a new destination address\n /// @param destinationAddress_ The new destination address to be set\n /// @custom:event Emits DestinationAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when destination address is zero\n function _setDestination(address destinationAddress_) internal {\n ensureNonzeroAddress(destinationAddress_);\n emit DestinationAddressUpdated(destinationAddress, destinationAddress_);\n destinationAddress = destinationAddress_;\n }\n\n /// @notice Sets a converter network contract address\n /// @param converterNetwork_ The converterNetwork address to be set\n /// @custom:event Emits ConverterNetworkAddressUpdated event on success\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n function _setConverterNetwork(IConverterNetwork converterNetwork_) internal {\n ensureNonzeroAddress(address(converterNetwork_));\n emit ConverterNetworkAddressUpdated(address(converterNetwork), address(converterNetwork_));\n converterNetwork = converterNetwork_;\n }\n\n /// @notice Min amount to convert setter\n /// @param minAmountToConvert_ Min amount to convert\n /// @custom:event MinAmountToConvertUpdated is emitted in success\n /// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0\n function _setMinAmountToConvert(uint256 minAmountToConvert_) internal {\n ensureNonzeroValue(minAmountToConvert_);\n emit MinAmountToConvertUpdated(minAmountToConvert, minAmountToConvert_);\n minAmountToConvert = minAmountToConvert_;\n }\n\n /// @dev Hook to perform after converting tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @param amountIn Amount of tokenIn converted\n /// @param amountOut Amount of tokenOut converted\n function _postConversionHook(\n address tokenAddressIn,\n address tokenAddressOut,\n uint256 amountIn,\n uint256 amountOut\n ) internal virtual {}\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n __AccessControlled_init(accessControlManager_);\n __ReentrancyGuard_init();\n __AbstractTokenConverter_init_unchained(priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param minAmountToConvert_ minimum amount to convert\n function __AbstractTokenConverter_init_unchained(\n ResilientOracle priceOracle_,\n address destinationAddress_,\n uint256 minAmountToConvert_\n ) internal onlyInitializing {\n _setPriceOracle(priceOracle_);\n _setDestination(destinationAddress_);\n _setMinAmountToConvert(minAmountToConvert_);\n conversionPaused = false;\n }\n\n /// @dev _updateAssetsState hook to update the states of reserves transferred for the specific comptroller\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return Amount of asset, for _privateConversion\n function _updateAssetsState(address comptroller, address asset) internal virtual returns (uint256) {}\n\n /// @dev This method is used to convert asset into base asset by converting them with other converters which supports the pair and transfer the funds to\n /// destination contract as destination's base asset\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressOut Address of the token transferred to converter, and through _privateConversion it will be converted into base asset\n /// @param amountToConvert Amount of the tokenAddressOut transferred to converter\n function _privateConversion(\n address comptroller,\n address tokenAddressOut,\n uint256 amountToConvert\n ) internal {\n address tokenAddressIn = _getDestinationBaseAsset();\n address _destinationAddress = destinationAddress;\n uint256 convertedTokenInBalance;\n if (address(converterNetwork) != address(0)) {\n (address[] memory converterAddresses, uint256[] memory converterBalances) = converterNetwork\n .findTokenConvertersForConverters(tokenAddressOut, tokenAddressIn);\n uint256 convertersLength = converterAddresses.length;\n for (uint256 i; i < convertersLength; ) {\n if (converterBalances[i] == 0) break;\n (, uint256 amountIn) = IAbstractTokenConverter(converterAddresses[i]).getUpdatedAmountIn(\n converterBalances[i],\n tokenAddressOut,\n tokenAddressIn\n );\n if (amountIn > amountToConvert) {\n amountIn = amountToConvert;\n }\n\n if (!_validateMinAmountToConvert(amountIn, tokenAddressOut)) {\n break;\n }\n\n uint256 balanceBefore = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n\n IERC20Upgradeable(tokenAddressOut).forceApprove(converterAddresses[i], amountIn);\n IAbstractTokenConverter(converterAddresses[i]).convertExactTokens(\n amountIn,\n 0,\n tokenAddressOut,\n tokenAddressIn,\n _destinationAddress\n );\n\n uint256 balanceAfter = IERC20Upgradeable(tokenAddressIn).balanceOf(_destinationAddress);\n amountToConvert -= amountIn;\n convertedTokenInBalance += (balanceAfter - balanceBefore);\n\n if (amountToConvert == 0) break;\n unchecked {\n ++i;\n }\n }\n }\n\n _postPrivateConversionHook(\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance,\n tokenAddressOut,\n amountToConvert\n );\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal virtual {}\n\n /// @notice This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal virtual {}\n\n /// @dev Checks if amount to convert is greater than minimum amount to convert or not\n /// @param amountIn The amount to convert\n /// @param tokenAddress Address of the token\n /// @return isValid true if amount to convert is greater than minimum amount to convert\n function _validateMinAmountToConvert(uint256 amountIn, address tokenAddress) internal returns (bool isValid) {\n priceOracle.updateAssetPrice(tokenAddress);\n uint256 amountInInUsd = (priceOracle.getPrice(tokenAddress) * amountIn) / EXP_SCALE;\n\n if (amountInInUsd >= minAmountToConvert) {\n isValid = true;\n }\n }\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountOutMantissa, uint256 tokenInToOutConversion) {\n if (amountInMantissa == 0) {\n revert InsufficientInputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n if (address(converterNetwork) != address(0) && (converterNetwork.isTokenConverter(msg.sender))) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n /// amount of tokenAddressOut after including incentive as amountOutMantissa will be greater than actual as it gets\n /// multiplied by conversionWithIncentive which will be >= 1\n amountOutMantissa = (amountInMantissa * tokenInToOutConversion) / (EXP_SCALE);\n }\n\n /// @dev To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @dev For user conversions, the function returns an amountInMantissa that is rounded up, ensuring that the equivalent amountInMantissa\n /// is obtained from users for corresponding amountOutMantissa, preventing any losses to the protocol. However, no rounding up is required for private conversions\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @return tokenInToOutConversion Ratio of tokenIn price and incentive for conversion with tokenOut price\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function _getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) internal view returns (uint256 amountInMantissa, uint256 tokenInToOutConversion) {\n if (amountOutMantissa == 0) {\n revert InsufficientOutputAmount();\n }\n\n ConversionConfig memory configuration = conversionConfigurations[tokenAddressIn][tokenAddressOut];\n\n if (configuration.conversionAccess == ConversionAccessibility.NONE) {\n revert ConversionConfigNotEnabled();\n }\n\n uint256 tokenInUnderlyingPrice = priceOracle.getPrice(tokenAddressIn);\n uint256 tokenOutUnderlyingPrice = priceOracle.getPrice(tokenAddressOut);\n\n uint256 incentive = configuration.incentive;\n\n bool isPrivateConversion = address(converterNetwork) != address(0) &&\n converterNetwork.isTokenConverter(msg.sender);\n if (isPrivateConversion) {\n incentive = 0;\n }\n\n /// conversion rate after considering incentive(conversionWithIncentive)\n uint256 conversionWithIncentive = MANTISSA_ONE + incentive;\n\n /// amount of tokenAddressIn after considering incentive(i.e. amountInMantissa will be less than actual amountInMantissa if incentive > 0)\n if (isPrivateConversion) {\n amountInMantissa =\n (amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE) /\n (tokenInUnderlyingPrice * conversionWithIncentive);\n } else {\n amountInMantissa = _divRoundingUp(\n amountOutMantissa * tokenOutUnderlyingPrice * EXP_SCALE,\n tokenInUnderlyingPrice * conversionWithIncentive\n );\n }\n\n tokenInToOutConversion = (tokenInUnderlyingPrice * conversionWithIncentive) / tokenOutUnderlyingPrice;\n }\n\n /// @dev Check if msg.sender is allowed to convert as per onlyForPrivateConversions flag\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @custom:error ConversionEnabledOnlyForPrivateConversions is thrown when conversion is only enabled for private conversion\n function _checkPrivateConversion(address tokenAddressIn, address tokenAddressOut) internal view {\n bool isConverter = (address(converterNetwork) != address(0)) && converterNetwork.isTokenConverter(msg.sender);\n if (\n (!(isConverter) &&\n (conversionConfigurations[tokenAddressIn][tokenAddressOut].conversionAccess ==\n ConversionAccessibility.ONLY_FOR_CONVERTERS))\n ) {\n revert ConversionEnabledOnlyForPrivateConversions();\n }\n }\n\n /// @dev To check, is conversion paused\n /// @custom:error ConversionTokensPaused is thrown when token conversion is paused\n function _checkConversionPaused() internal view {\n if (conversionPaused) {\n revert ConversionTokensPaused();\n }\n }\n\n /// @dev Get base asset address of the destination contract\n /// @return Address of the base asset\n function _getDestinationBaseAsset() internal view virtual returns (address) {}\n\n /// @dev Performs division where the result is rounded up\n /// @param numerator The numerator of the division operation\n /// @param denominator The denominator of the division operation. Must be non-zero\n /// @return The result of the division, rounded up\n function _divRoundingUp(uint256 numerator, uint256 denominator) internal pure returns (uint256) {\n return (numerator + denominator - 1) / denominator;\n }\n}\n" + }, + "contracts/TokenConverter/ConverterNetwork.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { AccessControlledV8 } from \"@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol\";\nimport { MaxLoopsLimitHelper } from \"@venusprotocol/solidity-utilities/contracts/MaxLoopsLimitHelper.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { sort } from \"../Utils/ArrayHelpers.sol\";\nimport { IAbstractTokenConverter } from \"./IAbstractTokenConverter.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @title ConverterNetwork\n/// @author Venus\n/// @notice ConverterNetwork keeps track of all the converters and is used to fetch valid converters which provide conversions according to token addresses provided\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract ConverterNetwork is IConverterNetwork, AccessControlledV8, MaxLoopsLimitHelper {\n /// @notice Array holding all the converters\n IAbstractTokenConverter[] public allConverters;\n\n /// @notice Emitted when new converter is added\n event ConverterAdded(address indexed converter);\n\n /// @notice Emitted when converter is removed\n event ConverterRemoved(address indexed converter);\n\n /// @notice Error thrown when converter already exists\n error ConverterAlreadyExists();\n\n /// @notice Error thrown converter does not exist\n error ConverterDoesNotExist();\n\n /// @notice Error thrown when converter address is invalid\n error InvalidTokenConverterAddress();\n\n /// @notice Error thrown when loops limit is invalid\n error InvalidMaxLoopsLimit(uint256 loopsLimit);\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @notice ConverterNetwork initializer\n /// @param _accessControlManager The address of ACM contract\n /// @param _loopsLimit Limit for the loops in the contract to avoid DOS\n /// @custom:event ConverterAdded is emitted for each converter added on success\n /// @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n function initialize(address _accessControlManager, uint256 _loopsLimit) external initializer {\n ensureNonzeroAddress(_accessControlManager);\n __AccessControlled_init(_accessControlManager);\n\n if (_loopsLimit >= type(uint128).max) revert InvalidMaxLoopsLimit(_loopsLimit);\n _setMaxLoopsLimit(_loopsLimit);\n }\n\n /**\n * @notice Set the limit for the loops can iterate to avoid the DOS\n * @param limit Limit for the max loops can execute at a time\n * @custom:error InvalidMaxLoopsLimit is thrown when when loops limit is invalid\n * @custom:access Only owner\n */\n function setMaxLoopsLimit(uint256 limit) external onlyOwner {\n if (limit >= type(uint128).max) revert InvalidMaxLoopsLimit(limit);\n _setMaxLoopsLimit(limit);\n }\n\n /// @notice Adds new converter to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:event ConverterAdded is emitted on success\n /// @custom:access Only Governance\n function addTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"addTokenConverter(address)\");\n _addTokenConverter(_tokenConverter);\n }\n\n /// @notice Removes converter from the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterDoesNotExist is thrown when converter to remove does not exist\n /// @custom:event ConverterRemoved is emitted on success\n /// @custom:access Only Governance\n function removeTokenConverter(IAbstractTokenConverter _tokenConverter) external {\n _checkAccessAllowed(\"removeTokenConverter(address)\");\n\n // Find the index of the converter in the array\n uint128 indexToRemove = _findConverterIndex(_tokenConverter);\n\n // Ensure that the converter exists in the array\n if (indexToRemove == type(uint128).max) revert ConverterDoesNotExist();\n\n // Swap the element to remove with the last element\n allConverters[indexToRemove] = allConverters[allConverters.length - 1];\n\n // Remove the last element (which is now a duplicate)\n allConverters.pop();\n\n emit ConverterRemoved(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to users for conversion\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, false);\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// It will return the converters which are open to converters for conversion.\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @return converters Array of the conveters on the basis of the tokens pair\n /// @return convertersBalance Array of balances with respect to token out\n function findTokenConvertersForConverters(address _tokenAddressIn, address _tokenAddressOut)\n external\n returns (address[] memory converters, uint256[] memory convertersBalance)\n {\n (converters, convertersBalance) = _findTokenConverters(_tokenAddressIn, _tokenAddressOut, true);\n }\n\n /// @notice This function returns the array containing all the converters addresses\n /// @return converters Array containing all the converters addresses\n function getAllConverters() external view returns (IAbstractTokenConverter[] memory converters) {\n converters = allConverters;\n }\n\n /// @notice This function checks if the given address is a converter or not\n /// @param _tokenConverter Address of the token converter\n /// @return isConverter true if given address is converter otherwise false\n function isTokenConverter(address _tokenConverter) external view returns (bool isConverter) {\n uint128 index = _findConverterIndex(IAbstractTokenConverter(_tokenConverter));\n\n if (index != type(uint128).max) {\n isConverter = true;\n }\n }\n\n /// @notice Adds new converter contract to the array\n /// @param _tokenConverter Address of the token converter\n /// @custom:error ConverterAlreadyExists is thrown when new tokenconverter to add already exists\n /// @custom:event ConverterAdded is emitted on success\n function _addTokenConverter(IAbstractTokenConverter _tokenConverter) internal {\n if (\n (address(_tokenConverter) == address(0)) || (address(_tokenConverter.converterNetwork()) != address(this))\n ) {\n revert InvalidTokenConverterAddress();\n }\n\n uint128 index = _findConverterIndex(_tokenConverter);\n if (index != type(uint128).max) revert ConverterAlreadyExists();\n\n allConverters.push(_tokenConverter);\n _ensureMaxLoops(allConverters.length);\n\n emit ConverterAdded(address(_tokenConverter));\n }\n\n /// @notice Used to get the array of converters supporting conversions, arranged in descending order based on token balances\n /// @param _tokenAddressIn Address of tokenIn\n /// @param _tokenAddressOut Address of tokenOut\n /// @param forConverters Bool to filter out converters on the basis of the conversionAccess\n /// @return converters Array of converters\n /// @return convertersBalance Array of balances with respect to token out\n function _findTokenConverters(\n address _tokenAddressIn,\n address _tokenAddressOut,\n bool forConverters\n ) internal returns (address[] memory converters, uint256[] memory convertersBalance) {\n uint128 convertersLength = uint128(allConverters.length);\n\n // Create a dynamic array to store the matching converters\n converters = new address[](convertersLength);\n convertersBalance = new uint256[](convertersLength);\n uint128 count;\n\n for (uint128 i; i < convertersLength; ) {\n IAbstractTokenConverter converter = allConverters[i];\n\n unchecked {\n ++i;\n }\n\n if ((address(converter.converterNetwork()) != address(this)) || msg.sender == address(converter)) {\n continue;\n }\n\n (, IAbstractTokenConverter.ConversionAccessibility conversionAccess) = converter.conversionConfigurations(\n _tokenAddressIn,\n _tokenAddressOut\n );\n\n if (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ALL) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n forConverters &&\n (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_CONVERTERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n } else if (\n !forConverters && (conversionAccess == IAbstractTokenConverter.ConversionAccessibility.ONLY_FOR_USERS)\n ) {\n converters[count] = address(converter);\n convertersBalance[count] = converter.balanceOf(_tokenAddressOut);\n ++count;\n }\n }\n\n // Resize the array to the actual number of matching converters\n assembly {\n mstore(converters, count)\n mstore(convertersBalance, count)\n }\n sort(convertersBalance, converters);\n }\n\n /// @notice Used to get the index of the converter stored in the array\n /// This will return the index if the converter exists in the array otherwise will return type(uint128).max\n /// @param _tokenConverter Address of the token converter\n /// @return index of the converter address in the allConverters array\n function _findConverterIndex(IAbstractTokenConverter _tokenConverter) internal view returns (uint128 index) {\n index = type(uint128).max; // Not found, return a large value\n\n uint128 convertersLength = uint128(allConverters.length);\n for (uint128 i; i < convertersLength; ) {\n if (allConverters[i] == _tokenConverter) {\n index = i;\n }\n unchecked {\n ++i;\n }\n }\n }\n}\n" + }, + "contracts/TokenConverter/IAbstractTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity ^0.8.25;\n\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { IConverterNetwork } from \"../Interfaces/IConverterNetwork.sol\";\n\n/// @notice Interface for AbstractTokenConverter\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ninterface IAbstractTokenConverter {\n /// @notice This enum define the all possible ways of conversion can happen\n enum ConversionAccessibility {\n NONE, // Conversion is disable for the pair\n ALL, // Conversion is enable for private conversion and users\n ONLY_FOR_CONVERTERS, // Conversion is enable only for private conversion\n ONLY_FOR_USERS // Conversion is enable only for users\n }\n\n /// @notice This struct represents the configuration for a token conversion.\n struct ConversionConfig {\n /// incentive on conversion of tokens in mantissa i.e 10% incentive would be 0.1 * 1e18\n uint256 incentive;\n /// enable or disable conversion for users or converters or both or none\n ConversionAccessibility conversionAccess;\n }\n\n /// @notice Pause conversion of tokens\n function pauseConversion() external;\n\n /// @notice Resume conversion of tokens.\n function resumeConversion() external;\n\n /// @notice Sets a new price oracle\n /// @param priceOracle_ Address of the new price oracle to set\n function setPriceOracle(ResilientOracle priceOracle_) external;\n\n /// @notice Set the configuration for new or existing convert pair\n /// @param tokenAddressIn Address of tokenIn\n /// @param tokenAddressOut Address of tokenOut\n /// @param conversionConfig ConversionConfig config details to update\n function setConversionConfig(\n address tokenAddressIn,\n address tokenAddressOut,\n ConversionConfig calldata conversionConfig\n ) external;\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @dev Method does not support deflationary tokens transfer\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert exact amount of tokenAddressIn for tokenAddressOut\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param amountOutMinMantissa Min amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMantissa,\n uint256 amountOutMinMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Convert tokens for tokenAddressIn for exact amount of tokenAddressOut\n /// @param amountInMaxMantissa Max amount of tokenAddressIn\n /// @param amountOutMantissa Amount of tokenAddressOut required as output\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after convert\n /// @param to Address of the tokenAddressOut receiver\n function convertForExactTokensSupportingFeeOnTransferTokens(\n uint256 amountInMaxMantissa,\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut,\n address to\n ) external returns (uint256 actualAmountIn, uint256 actualAmountOut);\n\n /// @notice Get the configuration for the pair of the tokens\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return incentives Percentage of incentives to be distributed for the pair of tokens\n /// @return conversionAccess Accessibility for the pair of tokens\n function conversionConfigurations(address tokenAddressIn, address tokenAddressOut)\n external\n returns (uint256 incentives, ConversionAccessibility conversionAccess);\n\n /// @notice Get the address of the converterNetwork\n function converterNetwork() external returns (IConverterNetwork converterNetwork);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getUpdatedAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressIn tokens sender would send on receiving amountOutMantissa tokens of tokenAddressOut\n /// @dev This function retrieves values without altering token prices.\n /// @param amountOutMantissa Amount of tokenAddressOut user wants to receive\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressOut should be transferred after conversion\n /// @return amountInMantissa Amount of the tokenAddressIn sender would send to contract before conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountIn(\n uint256 amountOutMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountInMantissa);\n\n /// @notice To get the amount of tokenAddressOut tokens sender could receive on providing amountInMantissa tokens of tokenAddressIn\n /// @dev This function retrieves values without altering token prices.\n /// @param amountInMantissa Amount of tokenAddressIn\n /// @param tokenAddressIn Address of the token to convert\n /// @param tokenAddressOut Address of the token to get after conversion\n /// @return amountConvertedMantissa Amount of tokenAddressIn should be transferred after conversion\n /// @return amountOutMantissa Amount of the tokenAddressOut sender should receive after conversion\n /// @custom:error InsufficientInputAmount error is thrown when given input amount is zero\n /// @custom:error ConversionConfigNotEnabled is thrown when conversion is disabled or config does not exist for given pair\n function getAmountOut(\n uint256 amountInMantissa,\n address tokenAddressIn,\n address tokenAddressOut\n ) external view returns (uint256 amountConvertedMantissa, uint256 amountOutMantissa);\n\n /// @notice Get the balance for specific token\n /// @param token Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address token) external view returns (uint256 tokenBalance);\n}\n" + }, + "contracts/TokenConverter/RiskFundConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress, ensureNonzeroValue } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\nimport { IPoolRegistry } from \"../Interfaces/IPoolRegistry.sol\";\nimport { IComptroller } from \"../Interfaces/IComptroller.sol\";\nimport { IRiskFund, IRiskFundGetters } from \"../Interfaces/IRiskFund.sol\";\nimport { IVToken } from \"../Interfaces/IVToken.sol\";\n\n/// @title RiskFundConverter\n/// @author Venus\n/// @notice RiskFundConverter used for token conversions and sends received token to RiskFund\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract RiskFundConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the core pool comptroller\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable CORE_POOL_COMPTROLLER;\n\n ///@notice Address of the vBNB\n ///@dev This address is used to include the BNB market while in getPools method\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable VBNB;\n\n ///@notice Address of the native wrapped currency\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n address public immutable NATIVE_WRAPPED;\n\n /// @notice Store the previous state for the asset transferred to ProtocolShareReserve combined(for all pools)\n mapping(address => uint256) internal assetsReserves;\n\n /// @notice Store the asset's reserve per pool in the ProtocolShareReserve\n /// @dev Comptroller(pool) -> Asset -> amount\n mapping(address => mapping(address => uint256)) internal poolsAssetsReserves;\n\n /// @notice Address of pool registry contract\n address public poolRegistry;\n\n /// @notice The mapping contains the assets for each pool which are sent to RiskFund directly\n /// @dev Comptroller(pool) -> Asset -> bool(should transfer directly on true)\n mapping(address => mapping(address => bool)) public poolsAssetsDirectTransfer;\n\n /// @notice Emitted when pool registry address is updated\n event PoolRegistryUpdated(address indexed oldPoolRegistry, address indexed newPoolRegistry);\n\n /// @notice Emitted after updating of the assets reserves\n /// amount -> reserve increased by amount\n event AssetsReservesUpdated(address indexed comptroller, address indexed asset, uint256 amount);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @notice Emitted after the poolsAssetsDirectTransfer mapping is updated\n event PoolAssetsDirectTransferUpdated(address indexed comptroller, address indexed asset, bool value);\n\n // Error thrown when comptrollers array length is not equal to assets array length\n error InvalidArguments();\n\n /// @notice thrown when amount entered is greater than balance\n error InsufficientBalance();\n\n /// @notice thrown when asset does not exist in the pool\n error MarketNotExistInPool(address comptroller, address asset);\n\n /// @notice thrown to prevent reentrancy\n /// @dev This error is used to safeguard against reentrancy attacks, ensuring that a certain operation\n /// cannot be called recursively within the same transaction.\n error ReentrancyGuardError();\n\n /// @param corePoolComptroller_ Address of the Comptroller pool\n /// @param vBNB_ Address of the vBNB\n /// @param nativeWrapped_ Address of the wrapped native currency\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor(\n address corePoolComptroller_,\n address vBNB_,\n address nativeWrapped_\n ) {\n ensureNonzeroAddress(corePoolComptroller_);\n ensureNonzeroAddress(vBNB_);\n ensureNonzeroAddress(nativeWrapped_);\n\n CORE_POOL_COMPTROLLER = corePoolComptroller_;\n VBNB = vBNB_;\n NATIVE_WRAPPED = nativeWrapped_;\n\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param poolRegistry_ Address of the pool registry\n /// @param minAmountToConvert_ minimum amount to convert\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address poolRegistry_,\n uint256 minAmountToConvert_,\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) public initializer {\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n ensureNonzeroAddress(poolRegistry_);\n poolRegistry = poolRegistry_;\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Pool registry setter\n /// @param poolRegistry_ Address of the pool registry\n /// @custom:event PoolRegistryUpdated emits on success\n /// @custom:error ZeroAddressNotAllowed is thrown when pool registry address is zero\n /// @custom:access Only Governance\n function setPoolRegistry(address poolRegistry_) external onlyOwner {\n ensureNonzeroAddress(poolRegistry_);\n emit PoolRegistryUpdated(poolRegistry, poolRegistry_);\n poolRegistry = poolRegistry_;\n }\n\n /// @notice Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:access Restricted by ACM\n function setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) external {\n _checkAccessAllowed(\"setPoolsAssetsDirectTransfer(address[],address[][],bool[][])\");\n _setPoolsAssetsDirectTransfer(comptrollers, assets, values);\n }\n\n /// @dev Get the Amount of the asset in the risk fund for the specific pool\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return reserves Asset's reserve in risk fund\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n /// @custom:error ReentrancyGuardError thrown to prevent reentrancy during the function execution\n function getPoolAssetReserve(address comptroller, address asset) external view returns (uint256 reserves) {\n if (_reentrancyGuardEntered()) revert ReentrancyGuardError();\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n reserves = poolsAssetsReserves[comptroller][asset];\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Reserves of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n tokenBalance = assetsReserves[tokenAddress];\n }\n\n /// @notice Get the array of all pools addresses\n /// @param tokenAddress Address of the token\n /// @return poolsWithCore Array of the pools addresses in which token is available\n function getPools(address tokenAddress) public view returns (address[] memory poolsWithCore) {\n poolsWithCore = IPoolRegistry(poolRegistry).getPoolsSupportedByAsset(tokenAddress);\n\n if (isAssetListedInCore(tokenAddress)) {\n uint256 poolsLength = poolsWithCore.length;\n address[] memory extendedPools = new address[](poolsLength + 1);\n\n for (uint256 i; i < poolsLength; ) {\n extendedPools[i] = poolsWithCore[i];\n unchecked {\n ++i;\n }\n }\n\n extendedPools[poolsLength] = CORE_POOL_COMPTROLLER;\n poolsWithCore = extendedPools;\n }\n }\n\n /// @dev This hook is used to update the state for asset reserves before transferring tokenOut to user\n /// @param tokenOutAddress Address of the asset to be transferred to the user\n /// @param amountOut Amount of tokenAddressOut transferred from this converter\n function _preTransferHook(address tokenOutAddress, uint256 amountOut) internal override {\n assetsReserves[tokenOutAddress] -= amountOut;\n }\n\n /// @notice Hook to perform after converting tokens\n /// @dev After transformation poolsAssetsReserves are settled by pool's reserves fraction\n /// @param tokenInAddress Address of the tokenIn\n /// @param tokenOutAddress Address of the tokenOut\n /// @param amountIn Amount of tokenIn transferred\n /// @param amountOut Amount of tokenOut transferred\n /// @custom:event AssetTransferredToDestination emits on success for each pool which has share\n function _postConversionHook(\n address tokenInAddress,\n address tokenOutAddress,\n uint256 amountIn,\n uint256 amountOut\n ) internal override {\n address[] memory pools = getPools(tokenOutAddress);\n uint256 assetReserve = assetsReserves[tokenOutAddress] + amountOut;\n ensureNonzeroValue(assetReserve);\n\n uint256 poolsLength = pools.length;\n uint256 distributedOutShare;\n uint256 poolAmountInShare;\n uint256 distributedInShare;\n\n for (uint256 i; i < poolsLength; ) {\n uint256 currentPoolsAssetsReserves = poolsAssetsReserves[pools[i]][tokenOutAddress];\n if (currentPoolsAssetsReserves != 0) {\n if (i < (poolsLength - 1)) {\n distributedOutShare += updatePoolAssetsReserve(pools[i], tokenOutAddress, amountOut, assetReserve);\n poolAmountInShare = (amountIn * currentPoolsAssetsReserves) / assetReserve;\n distributedInShare += poolAmountInShare;\n } else {\n uint256 distributedDiff = amountOut - distributedOutShare;\n poolsAssetsReserves[pools[i]][tokenOutAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenOutAddress, distributedDiff);\n poolAmountInShare = amountIn - distributedInShare;\n }\n emit AssetTransferredToDestination(destinationAddress, pools[i], tokenInAddress, poolAmountInShare);\n IRiskFund(destinationAddress).updatePoolState(pools[i], tokenInAddress, poolAmountInShare);\n }\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Operations to perform before sweeping tokens\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @custom:error InsufficientBalance is thrown when amount entered is greater than balance of token\n function preSweepToken(address tokenAddress, uint256 amount) internal override {\n uint256 balance = IERC20Upgradeable(tokenAddress).balanceOf(address(this));\n if (amount > balance) revert InsufficientBalance();\n uint256 balanceDiff = balance - assetsReserves[tokenAddress];\n\n if (balanceDiff < amount) {\n uint256 amountDiff;\n unchecked {\n amountDiff = amount - balanceDiff;\n }\n\n address[] memory pools = getPools(tokenAddress);\n uint256 assetReserve = assetsReserves[tokenAddress];\n uint256 poolsLength = pools.length;\n uint256 distributedShare;\n\n for (uint256 i; i < poolsLength; ) {\n if (poolsAssetsReserves[pools[i]][tokenAddress] != 0) {\n if (i < (poolsLength - 1)) {\n distributedShare += updatePoolAssetsReserve(pools[i], tokenAddress, amountDiff, assetReserve);\n } else {\n uint256 distributedDiff = amountDiff - distributedShare;\n poolsAssetsReserves[pools[i]][tokenAddress] -= distributedDiff;\n emit AssetsReservesUpdated(pools[i], tokenAddress, distributedDiff);\n }\n }\n unchecked {\n ++i;\n }\n }\n assetsReserves[tokenAddress] -= amountDiff;\n }\n }\n\n /// @dev Update the poolAssetsReserves upon transferring the tokens\n /// @param pool Address of the pool\n /// @param tokenAddress Address of the token\n /// @param amount Amount transferred to address(to)\n /// @param assetReserve Asset's reserve for the pool\n /// @return poolAmountShare Share of the pool as per it's reserve in compare to total reserves for the asset\n /// @custom:event AssetsReservesUpdated emits on success\n function updatePoolAssetsReserve(\n address pool,\n address tokenAddress,\n uint256 amount,\n uint256 assetReserve\n ) internal returns (uint256 poolAmountShare) {\n poolAmountShare = (poolsAssetsReserves[pool][tokenAddress] * amount) / assetReserve;\n poolsAssetsReserves[pool][tokenAddress] -= poolAmountShare;\n emit AssetsReservesUpdated(pool, tokenAddress, poolAmountShare);\n }\n\n /// @dev Update the poolsAssetsDirectTransfer mapping\n /// @param comptrollers Addresses of the pools\n /// @param assets Addresses of the assets need to be added for direct transfer\n /// @param values Boolean value to indicate whether direct transfer is allowed for each asset.\n /// @custom:event PoolAssetsDirectTransferUpdated emits on success\n /// @custom:error InvalidArguments thrown when comptrollers array length is not equal to assets array length\n function _setPoolsAssetsDirectTransfer(\n address[] calldata comptrollers,\n address[][] calldata assets,\n bool[][] calldata values\n ) internal {\n uint256 comptrollersLength = comptrollers.length;\n\n if ((comptrollersLength != assets.length) || (comptrollersLength != values.length)) {\n revert InvalidArguments();\n }\n\n for (uint256 i; i < comptrollersLength; ) {\n address[] memory poolAssets = assets[i];\n bool[] memory assetsValues = values[i];\n uint256 poolAssetsLength = poolAssets.length;\n\n if (poolAssetsLength != assetsValues.length) {\n revert InvalidArguments();\n }\n\n for (uint256 j; j < poolAssetsLength; ) {\n poolsAssetsDirectTransfer[comptrollers[i]][poolAssets[j]] = assetsValues[j];\n emit PoolAssetsDirectTransferUpdated(comptrollers[i], poolAssets[j], assetsValues[j]);\n unchecked {\n ++j;\n }\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev Update the reserve of the asset for the specific pool after transferring to risk fund\n /// and transferring funds to the protocol share reserve\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address\n /// @return balanceDifference Amount of asset, for _privateConversion\n /// @custom:event AssetTransferredToDestination emits when poolsAssetsDirectTransfer is enabled for entered comptroller and asset\n /// @custom:error MarketNotExistInPool When asset does not exist in the pool(comptroller)\n function _updateAssetsState(address comptroller, address asset)\n internal\n override\n returns (uint256 balanceDifference)\n {\n if (!ensureAssetListed(comptroller, asset)) revert MarketNotExistInPool(comptroller, asset);\n\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 currentBalance = token.balanceOf(address(this));\n uint256 assetReserve = assetsReserves[asset];\n if (currentBalance > assetReserve) {\n unchecked {\n balanceDifference = currentBalance - assetReserve;\n }\n if (poolsAssetsDirectTransfer[comptroller][asset]) {\n uint256 previousDestinationBalance = token.balanceOf(destinationAddress);\n token.safeTransfer(destinationAddress, balanceDifference);\n uint256 newDestinationBalance = token.balanceOf(destinationAddress);\n\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balanceDifference);\n IRiskFund(destinationAddress).updatePoolState(\n comptroller,\n asset,\n newDestinationBalance - previousDestinationBalance\n );\n balanceDifference = 0;\n }\n }\n }\n\n /// @dev This hook is used to update states for the converter after the privateConversion\n /// @param comptroller Comptroller address (pool)\n /// @param tokenAddressIn Address of the destination's base asset\n /// @param convertedTokenInBalance Amount of the base asset received after the conversion\n /// @param tokenAddressOut Address of the asset transferred to other converter in exchange of base asset\n /// @param convertedTokenOutBalance Amount of tokenAddressOut transferred from this converter\n function _postPrivateConversionHook(\n address comptroller,\n address tokenAddressIn,\n uint256 convertedTokenInBalance,\n address tokenAddressOut,\n uint256 convertedTokenOutBalance\n ) internal override {\n if (convertedTokenInBalance > 0) {\n emit AssetTransferredToDestination(\n destinationAddress,\n comptroller,\n tokenAddressIn,\n convertedTokenInBalance\n );\n IRiskFund(destinationAddress).updatePoolState(comptroller, tokenAddressIn, convertedTokenInBalance);\n }\n if (convertedTokenOutBalance > 0) {\n assetsReserves[tokenAddressOut] += convertedTokenOutBalance;\n poolsAssetsReserves[comptroller][tokenAddressOut] += convertedTokenOutBalance;\n emit AssetsReservesUpdated(comptroller, tokenAddressOut, convertedTokenOutBalance);\n }\n }\n\n /// @dev This function checks for the given asset is listed in core pool or not\n /// @param tokenAddress Address of the asset\n /// @return isAssetListed true if the asset is listed\n function isAssetListedInCore(address tokenAddress) internal view returns (bool isAssetListed) {\n address[] memory coreMarkets = IComptroller(CORE_POOL_COMPTROLLER).getAllMarkets();\n\n uint256 coreMarketsLength = coreMarkets.length;\n for (uint256 i; i < coreMarketsLength; ) {\n isAssetListed = (VBNB == coreMarkets[i])\n ? (tokenAddress == NATIVE_WRAPPED)\n : (IVToken(coreMarkets[i]).underlying() == tokenAddress);\n\n if (isAssetListed) {\n break;\n }\n\n unchecked {\n ++i;\n }\n }\n }\n\n /// @dev This function checks for the given asset is listed or not\n /// @param comptroller Address of the comptroller\n /// @param asset Address of the asset\n /// @return isListed true if the asset is listed\n function ensureAssetListed(address comptroller, address asset) internal view returns (bool isListed) {\n if (comptroller == CORE_POOL_COMPTROLLER) {\n isListed = isAssetListedInCore(asset);\n } else {\n isListed = IPoolRegistry(poolRegistry).getVTokenForAsset(comptroller, asset) != address(0);\n }\n }\n\n /// @dev Get base asset address of the RiskFund\n /// @return destinationBaseAsset Address of the base asset(RiskFund)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = IRiskFundGetters(destinationAddress).convertibleBaseAsset();\n }\n}\n" + }, + "contracts/TokenConverter/SingleTokenConverter.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\nimport { SafeERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\";\nimport { IERC20Upgradeable } from \"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\";\nimport { ResilientOracle } from \"@venusprotocol/oracle/contracts/ResilientOracle.sol\";\nimport { ensureNonzeroAddress } from \"@venusprotocol/solidity-utilities/contracts/validators.sol\";\n\nimport { AbstractTokenConverter } from \"./AbstractTokenConverter.sol\";\n\n/// @title SingleTokenConverter\n/// @author Venus\n/// @notice SingleTokenConverter used for token conversions and sends received tokens\n/// @custom:security-contact https://github.com/VenusProtocol/protocol-reserve#discussion\ncontract SingleTokenConverter is AbstractTokenConverter {\n using SafeERC20Upgradeable for IERC20Upgradeable;\n\n /// @notice Address of the base asset token\n address public baseAsset;\n\n /// @notice Emitted when base asset is updated\n event BaseAssetUpdated(address indexed oldBaseAsset, address indexed newBaseAsset);\n\n /// @notice Emmitted after the funds transferred to the destination address\n event AssetTransferredToDestination(\n address indexed receiver,\n address indexed comptroller,\n address indexed asset,\n uint256 amount\n );\n\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() {\n // Note that the contract is upgradeable. Use initialize() or reinitializers\n // to set the state variables.\n _disableInitializers();\n }\n\n /// @param accessControlManager_ Access control manager contract address\n /// @param priceOracle_ Resilient oracle address\n /// @param destinationAddress_ Address at all incoming tokens will transferred to\n /// @param baseAsset_ Address of the base asset\n /// @param minAmountToConvert_ Minimum amount to convert\n function initialize(\n address accessControlManager_,\n ResilientOracle priceOracle_,\n address destinationAddress_,\n address baseAsset_,\n uint256 minAmountToConvert_\n ) public initializer {\n _setBaseAsset(baseAsset_);\n\n // Initialize AbstractTokenConverter\n __AbstractTokenConverter_init(accessControlManager_, priceOracle_, destinationAddress_, minAmountToConvert_);\n }\n\n /// @notice Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:access Only Governance\n function setBaseAsset(address baseAsset_) external onlyOwner {\n _setBaseAsset(baseAsset_);\n }\n\n /// @notice Get the balance for specific token\n /// @param tokenAddress Address of the token\n /// @return tokenBalance Balance of the token the contract has\n function balanceOf(address tokenAddress) public view override returns (uint256 tokenBalance) {\n IERC20Upgradeable token = IERC20Upgradeable(tokenAddress);\n tokenBalance = token.balanceOf(address(this));\n }\n\n /// @param comptroller Comptroller address (pool)\n /// @param asset Asset address.\n /// @return balanceLeft Amount of asset, for _privateConversion\n // solhint-disable-next-line\n function _updateAssetsState(address comptroller, address asset) internal override returns (uint256 balanceLeft) {\n IERC20Upgradeable token = IERC20Upgradeable(asset);\n uint256 balance = token.balanceOf(address(this));\n balanceLeft = balance;\n\n if (asset == baseAsset) {\n balanceLeft = 0;\n token.safeTransfer(destinationAddress, balance);\n emit AssetTransferredToDestination(destinationAddress, comptroller, asset, balance);\n }\n }\n\n /// @dev Sets the base asset for the contract\n /// @param baseAsset_ The new address of the base asset\n /// @custom:error ZeroAddressNotAllowed is thrown when address is zero\n /// @custom:event BaseAssetUpdated is emitted on success\n function _setBaseAsset(address baseAsset_) internal {\n ensureNonzeroAddress(baseAsset_);\n emit BaseAssetUpdated(baseAsset, baseAsset_);\n baseAsset = baseAsset_;\n }\n\n /// @dev Get base asset address\n /// @return destinationBaseAsset Address of the base asset(baseAsset)\n function _getDestinationBaseAsset() internal view override returns (address destinationBaseAsset) {\n destinationBaseAsset = baseAsset;\n }\n}\n" + }, + "contracts/Utils/ArrayHelpers.sol": { + "content": "// SPDX-License-Identifier: BSD-3-Clause\npragma solidity 0.8.25;\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\nfunction sort(uint256[] memory arr, address[] memory addrs) pure {\n if (arr.length > 1) {\n return quickSortDescending(arr, addrs, 0, arr.length - 1);\n }\n}\n\n/// @notice Used to sort addresses array based on their token balances\n/// @param arr Array of token balances of different addresses\n/// @param addrs Array containing these addresses\n/// @param left index of first value\n/// @param right index of last value\nfunction quickSortDescending(\n uint256[] memory arr,\n address[] memory addrs,\n uint256 left,\n uint256 right\n) pure {\n if (left >= right) return;\n uint256 p = arr[(left + right) / 2]; // p = the pivot element\n uint256 i = left;\n uint256 j = right;\n while (i < j) {\n while (arr[i] > p) ++i;\n while (arr[j] < p) --j; // arr[j] < p means p still to the right, so j > 0\n if (arr[i] < arr[j]) {\n (arr[i], arr[j]) = (arr[j], arr[i]);\n (addrs[i], addrs[j]) = (addrs[j], addrs[i]);\n } else {\n ++i;\n }\n }\n\n if (j > left) quickSortDescending(arr, addrs, left, j - 1); // j > left, so j > 0\n quickSortDescending(arr, addrs, j + 1, right);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor (address initialOwner) {\n _transferOwnership(initialOwner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/interfaces/draft-IERC1822.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/beacon/IBeacon.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/ERC1967/ERC1967Upgrade.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view virtual returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(Address.isContract(IBeacon(newBeacon).implementation()), \"ERC1967: beacon implementation is not a contract\");\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/Proxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/ProxyAdmin.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./TransparentUpgradeableProxy.sol\";\nimport \"../../access/Ownable.sol\";\n\n/**\n * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an\n * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}.\n */\ncontract ProxyAdmin is Ownable {\n\n constructor (address initialOwner) Ownable(initialOwner) {}\n\n /**\n * @dev Returns the current implementation of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the current admin of `proxy`.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of `proxy` to `newAdmin`.\n *\n * Requirements:\n *\n * - This contract must be the current admin of `proxy`.\n */\n function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See\n * {TransparentUpgradeableProxy-upgradeToAndCall}.\n *\n * Requirements:\n *\n * - This contract must be the admin of `proxy`.\n */\n function upgradeAndCall(\n TransparentUpgradeableProxy proxy,\n address implementation,\n bytes memory data\n ) public payable virtual onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0-rc.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 functionCall(target, data, \"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 require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(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 require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(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 require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason 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 // 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\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}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/openzeppelin/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" + }, + "hardhat-deploy/solc_0.8/proxy/OptimizedTransparentUpgradeableProxy.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../openzeppelin/proxy/ERC1967/ERC1967Proxy.sol\";\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract OptimizedTransparentUpgradeableProxy is ERC1967Proxy {\n address internal immutable _ADMIN;\n\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.admin\")) - 1));\n _ADMIN = admin_;\n\n // still store it to work with EIP-1967\n bytes32 slot = _ADMIN_SLOT;\n // solhint-disable-next-line no-inline-assembly\n assembly {\n sstore(slot, admin_)\n }\n emit AdminChanged(address(0), admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(\"\"), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(msg.sender != _getAdmin(), \"TransparentUpgradeableProxy: admin cannot fallback to proxy target\");\n super._beforeFallback();\n }\n\n function _getAdmin() internal view virtual override returns (address) {\n return _ADMIN;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 10000 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "storageLayout", + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "evm.gasEstimates" + ], + "": ["ast"] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index a7af2fdc..9d10d875 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -215,6 +215,12 @@ const config: HardhatUserConfig = { live: true, accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], }, + basemainnet: { + url: process.env.ARCHIVE_NODE_basemainnet || "https://mainnet.base.org", + chainId: 8453, + live: true, + accounts: DEPLOYER_PRIVATE_KEY ? [`0x${DEPLOYER_PRIVATE_KEY}`] : [], + }, }, etherscan: { apiKey: { @@ -229,6 +235,7 @@ const config: HardhatUserConfig = { opsepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", opmainnet: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", basesepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", + basemainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", }, customChains: [ { @@ -319,6 +326,14 @@ const config: HardhatUserConfig = { browserURL: "https://sepolia.basescan.org/", }, }, + { + network: "basemainnet", + chainId: 8453, + urls: { + apiURL: "https://mainnet.base.org", + browserURL: "https://basescan.org/", + }, + }, ], }, paths: { diff --git a/helpers/utils.ts b/helpers/utils.ts index 447a34e1..7a785e85 100644 --- a/helpers/utils.ts +++ b/helpers/utils.ts @@ -36,4 +36,5 @@ export const multisigs: ChainAddressesConfig = { opsepolia: "0xd57365EE4E850e881229e2F8Aa405822f289e78d", opmainnet: "0x2e94dd14E81999CdBF5deDE31938beD7308354b3", basesepolia: "0xdf3b635d2b535f906BB02abb22AED71346E36a00", + basemainnet: "0x1803Cf1D3495b43cC628aa1d8638A981F8CD341C", }; From be43ca82330299c8e413991ea96c2c66abbac3d8 Mon Sep 17 00:00:00 2001 From: web3rover Date: Fri, 6 Dec 2024 10:03:06 +0000 Subject: [PATCH 22/24] feat: updating deployment files --- deployments/basemainnet.json | 2049 ++++++++++++++++++++++++ deployments/basemainnet_addresses.json | 10 + 2 files changed, 2059 insertions(+) create mode 100644 deployments/basemainnet.json create mode 100644 deployments/basemainnet_addresses.json diff --git a/deployments/basemainnet.json b/deployments/basemainnet.json new file mode 100644 index 00000000..ec2a7dcc --- /dev/null +++ b/deployments/basemainnet.json @@ -0,0 +1,2049 @@ +{ + "name": "basemainnet", + "chainId": "8453", + "contracts": { + "DefaultProxyAdmin": { + "address": "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeProxyAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + } + ], + "name": "getProxyImplementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "upgrade", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract TransparentUpgradeableProxy", + "name": "proxy", + "type": "address" + }, + { + "internalType": "address", + "name": "implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ] + }, + "ProtocolShareReserve": { + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + } + ] + }, + "ProtocolShareReserve_Implementation": { + "address": "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_corePoolComptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "_wbnb", + "type": "address" + }, + { + "internalType": "address", + "name": "_vbnb", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTotalPercentage", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "loopsLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "requiredLoops", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "calledContract", + "type": "address" + }, + { + "internalType": "string", + "name": "methodSignature", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [], + "name": "ZeroAddressNotAllowed", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "percent", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "AssetReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "AssetsReservesUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "oldPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "uint16", + "name": "newPercentage", + "type": "uint16" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "DistributionConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxLoopsLimit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newmaxLoopsLimit", + "type": "uint256" + } + ], + "name": "MaxLoopsLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldAccessControlManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAccessControlManager", + "type": "address" + } + ], + "name": "NewAccessControlManager", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "oldPoolRegistry", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newPoolRegistry", + "type": "address" + } + ], + "name": "PoolRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newBalance", + "type": "uint256" + } + ], + "name": "ReservesUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "CORE_POOL_COMPTROLLER", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MAX_PERCENT", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "WBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "accessControlManager", + "outputs": [ + { + "internalType": "contract IAccessControlManagerV8", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "internalType": "struct ProtocolShareReserve.DistributionConfig[]", + "name": "configs", + "type": "tuple[]" + } + ], + "name": "addOrUpdateDistributionConfigs", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "", + "type": "uint8" + } + ], + "name": "assetsReserves", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "distributionTargets", + "outputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "uint16", + "name": "percentage", + "type": "uint16" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + } + ], + "name": "getPercentageDistribution", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + } + ], + "name": "getUnreleasedFunds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_accessControlManager", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_loopsLimit", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "maxLoopsLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "poolRegistry", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address[]", + "name": "assets", + "type": "address[]" + } + ], + "name": "releaseFunds", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum ProtocolShareReserve.Schema", + "name": "schema", + "type": "uint8" + }, + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "name": "removeDistributionConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "accessControlManager_", + "type": "address" + } + ], + "name": "setAccessControlManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_poolRegistry", + "type": "address" + } + ], + "name": "setPoolRegistry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalAssetReserve", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalDistributions", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "comptroller", + "type": "address" + }, + { + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "internalType": "enum IProtocolShareReserve.IncomeType", + "name": "incomeType", + "type": "uint8" + } + ], + "name": "updateAssetsState", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vBNB", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] + }, + "ProtocolShareReserve_Proxy": { + "address": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] + } + } +} diff --git a/deployments/basemainnet_addresses.json b/deployments/basemainnet_addresses.json new file mode 100644 index 00000000..75b8bf19 --- /dev/null +++ b/deployments/basemainnet_addresses.json @@ -0,0 +1,10 @@ +{ + "name": "basemainnet", + "chainId": "8453", + "addresses": { + "DefaultProxyAdmin": "0x7B06EF6b68648C61aFE0f715740fE3950B90746B", + "ProtocolShareReserve": "0x3565001d57c91062367C3792B74458e3c6eD910a", + "ProtocolShareReserve_Implementation": "0x8991cC6b4494B71621f5a4f6633695F896fd37ee", + "ProtocolShareReserve_Proxy": "0x3565001d57c91062367C3792B74458e3c6eD910a" + } +} From b7e116f913d6559d8becaeb1ba8e362d25a861a4 Mon Sep 17 00:00:00 2001 From: Jesus Lanchas Date: Sat, 14 Dec 2024 21:57:48 +0100 Subject: [PATCH 23/24] fixup! feat: deployed on base mainnet --- hardhat.config.ts | 10 +++++++--- package.json | 4 ++-- yarn.lock | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/hardhat.config.ts b/hardhat.config.ts index 9d10d875..d19a5981 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -79,7 +79,11 @@ const externalDeployments = { ], basesepolia: [ "node_modules/@venusprotocol/governance-contracts/deployments/basesepolia", - // TODO: "node_modules/@venusprotocol/oracle/deployments/basesepolia", + "node_modules/@venusprotocol/oracle/deployments/basesepolia", + ], + basemainnet: [ + "node_modules/@venusprotocol/governance-contracts/deployments/basemainnet", + "node_modules/@venusprotocol/oracle/deployments/basemainnet", ], }; @@ -235,7 +239,7 @@ const config: HardhatUserConfig = { opsepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", opmainnet: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", basesepolia: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", - basemainnet: process.env.ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", + basemainnet: ETHERSCAN_API_KEY || "ETHERSCAN_API_KEY", }, customChains: [ { @@ -330,7 +334,7 @@ const config: HardhatUserConfig = { network: "basemainnet", chainId: 8453, urls: { - apiURL: "https://mainnet.base.org", + apiURL: "https://api.basescan.org/api", browserURL: "https://basescan.org/", }, }, diff --git a/package.json b/package.json index 6e044a1f..f1d655da 100644 --- a/package.json +++ b/package.json @@ -76,9 +76,9 @@ "@types/node": "^18.16.3", "@typescript-eslint/eslint-plugin": "^5.44.0", "@typescript-eslint/parser": "^5.44.0", - "@venusprotocol/governance-contracts": "^2.5.0", + "@venusprotocol/governance-contracts": "^2.6.0", "@venusprotocol/isolated-pools": "^3.4.0", - "@venusprotocol/oracle": "^2.6.0", + "@venusprotocol/oracle": "^2.7.0", "bignumber.js": "^9.1.1", "chai": "^4.3.7", "dotenv": "^16.0.3", diff --git a/yarn.lock b/yarn.lock index 2ca8f821..862af72b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3495,14 +3495,14 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/governance-contracts@npm:^2.5.0": - version: 2.5.0 - resolution: "@venusprotocol/governance-contracts@npm:2.5.0" +"@venusprotocol/governance-contracts@npm:^2.6.0": + version: 2.6.0 + resolution: "@venusprotocol/governance-contracts@npm:2.6.0" dependencies: "@venusprotocol/solidity-utilities": 2.0.0 hardhat-deploy-ethers: ^0.3.0-beta.13 module-alias: ^2.2.2 - checksum: 1dce18deb79df8dbde91ff3b68c35c31fb58bd7549bba86ee25fcf99a802e393612ac6f5460c95c1bc635c2334f8c967409cf380758cafc81f42a562ac8514c1 + checksum: 7b4e8034961d02a3ae1f33b9a771e98d1ae39576ae60222433c2d33d184b7f6d8e1368a050dfe1d40f4ce3a0341e6500f00dd6e64c58a35092c942c125247c77 languageName: node linkType: hard @@ -3523,9 +3523,9 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/oracle@npm:^2.6.0": - version: 2.6.0 - resolution: "@venusprotocol/oracle@npm:2.6.0" +"@venusprotocol/oracle@npm:^2.7.0": + version: 2.7.0 + resolution: "@venusprotocol/oracle@npm:2.7.0" dependencies: "@chainlink/contracts": ^0.5.1 "@defi-wonderland/smock": 2.3.5 @@ -3540,7 +3540,7 @@ __metadata: hardhat-deploy: ^0.12.4 module-alias: ^2.2.2 solidity-docgen: ^0.6.0-beta.29 - checksum: 47c36e0cbba6f4963113e8e2db268063a52f4ffe913a8aab398f25d5c83ac5f448e45cb57992cb8f406e1be9a581557b7c75c4d8754d42f5d3164bff49f2b5c9 + checksum: 1fd036da69399b2d7024958bf12e07b053be553d0ba136334035b055b691a2b3b748dd6f52f6756c9770a216df8a8915a0e1a49d7169efcd1c658a21107e2ba4 languageName: node linkType: hard @@ -3593,9 +3593,9 @@ __metadata: "@types/node": ^18.16.3 "@typescript-eslint/eslint-plugin": ^5.44.0 "@typescript-eslint/parser": ^5.44.0 - "@venusprotocol/governance-contracts": ^2.5.0 + "@venusprotocol/governance-contracts": ^2.6.0 "@venusprotocol/isolated-pools": ^3.4.0 - "@venusprotocol/oracle": ^2.6.0 + "@venusprotocol/oracle": ^2.7.0 "@venusprotocol/solidity-utilities": ^2.0.3 "@venusprotocol/venus-protocol": ^9.1.0 bignumber.js: ^9.1.1 From 7e94e5b30e08957c4d3ad5cf9ded8ce7417d6307 Mon Sep 17 00:00:00 2001 From: Venus Tools Date: Wed, 18 Dec 2024 07:14:54 +0000 Subject: [PATCH 24/24] chore(release): 3.0.0-dev.4 [skip ci] ## [3.0.0-dev.4](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.3...v3.0.0-dev.4) (2024-12-18) ### Features * deployed on base mainnet ([c7f7b64](https://github.com/VenusProtocol/protocol-reserve/commit/c7f7b649ca9e31f253150bc1bdd9d35451e7da20)) * updating deployment files ([be43ca8](https://github.com/VenusProtocol/protocol-reserve/commit/be43ca82330299c8e413991ea96c2c66abbac3d8)) --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd961465..2580fca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [3.0.0-dev.4](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.3...v3.0.0-dev.4) (2024-12-18) + + +### Features + +* deployed on base mainnet ([c7f7b64](https://github.com/VenusProtocol/protocol-reserve/commit/c7f7b649ca9e31f253150bc1bdd9d35451e7da20)) +* updating deployment files ([be43ca8](https://github.com/VenusProtocol/protocol-reserve/commit/be43ca82330299c8e413991ea96c2c66abbac3d8)) + ## [3.0.0-dev.3](https://github.com/VenusProtocol/protocol-reserve/compare/v3.0.0-dev.2...v3.0.0-dev.3) (2024-12-03) diff --git a/package.json b/package.json index f1d655da..2e259ded 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@venusprotocol/protocol-reserve", "description": "Venus Protocol contracts to manage the income generated by the protocol", - "version": "3.0.0-dev.3", + "version": "3.0.0-dev.4", "author": "Venus", "engines": { "node": ">=18.0.0"